UNPKG

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