@oclif/test 2.1.2 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/command.d.ts +1 -0
- package/lib/command.js +1 -1
- package/lib/exit.d.ts +1 -3
- package/lib/exit.js +0 -3
- package/lib/hook.d.ts +2 -0
- package/lib/hook.js +1 -3
- package/lib/index.d.ts +2 -0
- package/package.json +3 -3
package/lib/command.d.ts
CHANGED
package/lib/command.js
CHANGED
|
@@ -18,7 +18,7 @@ function command(args, opts = {}) {
|
|
|
18
18
|
const cmdId = (0, core_1.toStandardizedId)(id, ctx.config);
|
|
19
19
|
ctx.expectation = ctx.expectation || `runs ${args.join(' ')}`;
|
|
20
20
|
await ctx.config.runHook('init', { id: cmdId, argv: extra });
|
|
21
|
-
await ctx.config.runCommand(cmdId, extra);
|
|
21
|
+
ctx.returned = await ctx.config.runCommand(cmdId, extra);
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
}
|
package/lib/exit.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="mocha" />
|
|
1
2
|
declare const _default: (code?: number) => {
|
|
2
3
|
run(): never;
|
|
3
4
|
catch(ctx: {
|
|
@@ -6,8 +7,5 @@ declare const _default: (code?: number) => {
|
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
8
9
|
* ensures that a oclif command or hook exits
|
|
9
|
-
*
|
|
10
|
-
* @param {number} code expected code
|
|
11
|
-
* @default 0
|
|
12
10
|
*/
|
|
13
11
|
export default _default;
|
package/lib/exit.js
CHANGED
package/lib/hook.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
/// <reference types="mocha" />
|
|
1
2
|
import { Interfaces } from '@oclif/core';
|
|
2
3
|
import { loadConfig } from './load-config';
|
|
3
4
|
declare const _default: (event: string, hookOpts?: Record<string, unknown>, options?: loadConfig.Options) => {
|
|
4
5
|
run(ctx: {
|
|
5
6
|
config: Interfaces.Config;
|
|
6
7
|
expectation: string;
|
|
8
|
+
returned: unknown;
|
|
7
9
|
}): Promise<void>;
|
|
8
10
|
};
|
|
9
11
|
/**
|
package/lib/hook.js
CHANGED
|
@@ -17,11 +17,9 @@ exports.default = (event, hookOpts = {}, options = {}) => ({
|
|
|
17
17
|
async run(ctx) {
|
|
18
18
|
if (!event)
|
|
19
19
|
throw new Error('no hook provided');
|
|
20
|
-
// eslint-disable-next-line require-atomic-updates
|
|
21
20
|
if (!ctx.config)
|
|
22
21
|
ctx.config = await (0, load_config_1.loadConfig)(options).run({});
|
|
23
|
-
// eslint-disable-next-line require-atomic-updates
|
|
24
22
|
ctx.expectation = ctx.expectation || `runs ${event} hook`;
|
|
25
|
-
await ctx.config.runHook(event, hookOpts || {});
|
|
23
|
+
ctx.returned = await ctx.config.runHook(event, hookOpts || {});
|
|
26
24
|
},
|
|
27
25
|
});
|
package/lib/index.d.ts
CHANGED
|
@@ -91,6 +91,7 @@ export declare const test: FancyTypes.Base<FancyTypes.Context, {
|
|
|
91
91
|
output: {
|
|
92
92
|
config: import("@oclif/core/lib/interfaces").Config;
|
|
93
93
|
expectation: string;
|
|
94
|
+
returned: unknown;
|
|
94
95
|
};
|
|
95
96
|
args: [args: string | string[], opts?: loadConfig.Options | undefined];
|
|
96
97
|
};
|
|
@@ -106,6 +107,7 @@ export declare const test: FancyTypes.Base<FancyTypes.Context, {
|
|
|
106
107
|
output: {
|
|
107
108
|
config: import("@oclif/core/lib/interfaces").Config;
|
|
108
109
|
expectation: string;
|
|
110
|
+
returned: unknown;
|
|
109
111
|
};
|
|
110
112
|
args: [event: string, hookOpts?: Record<string, unknown> | undefined, options?: loadConfig.Options | undefined];
|
|
111
113
|
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/test",
|
|
3
3
|
"description": "test helpers for oclif components",
|
|
4
|
-
"version": "2.1
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/test/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@oclif/core": "^1.16.4",
|
|
9
|
-
"fancy-test": "^2.0.
|
|
9
|
+
"fancy-test": "^2.0.2"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/chai": "^4.1.7",
|
|
13
13
|
"@types/mocha": "^9.1.1",
|
|
14
|
-
"@types/node": "^14.18.
|
|
14
|
+
"@types/node": "^14.18.30",
|
|
15
15
|
"chai": "^4.2.0",
|
|
16
16
|
"eslint": "^7.32.0",
|
|
17
17
|
"eslint-config-oclif": "^4.0.0",
|