UNPKG

777 BTypeScriptView Raw
1/// <reference types="mocha" />
2import { Interfaces } from '@oclif/core';
3import { loadConfig } from './load-config';
4declare const _default: (event: string, hookOpts?: Record<string, unknown>, options?: loadConfig.Options) => {
5 run(ctx: {
6 config: Interfaces.Config;
7 expectation: string;
8 returned: unknown;
9 }): Promise<void>;
10};
11/**
12 * tests a oclif hook
13 *
14 * @example <caption>check that when the 'init' hook is ran it outputs "this output"</caption>
15 * testHook('init', {id: 'mycommand'}, {stdout: true}, output => {
16 * expect(output.stdout).to.contain('this output')
17 * })
18 *
19 * @param {string} event hook to run
20 * @param {object} hookOpts options to pass to hook. Config object will be passed automatically.
21 */
22export default _default;