@oclif/test 2.5.6 → 2.5.7-beta.0
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/README.md +0 -1
- package/lib/exit.d.ts +3 -3
- package/lib/hook.d.ts +7 -7
- package/lib/index.d.ts +10 -10
- package/lib/index.js +10 -8
- package/lib/load-config.js +1 -1
- package/package.json +15 -14
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
test helpers for oclif components
|
|
5
5
|
|
|
6
6
|
[](https://npmjs.org/package/@oclif/test)
|
|
7
|
-
[](https://circleci.com/gh/oclif/test/tree/main)
|
|
8
7
|
[](https://snyk.io/test/npm/@oclif/test)
|
|
9
8
|
[](https://npmjs.org/package/@oclif/test)
|
|
10
9
|
[](https://github.com/oclif/test/blob/main/package.json)
|
package/lib/exit.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="mocha" />
|
|
2
|
+
/**
|
|
3
|
+
* ensures that a oclif command or hook exits
|
|
4
|
+
*/
|
|
2
5
|
declare const _default: (code?: number) => {
|
|
3
6
|
run(): never;
|
|
4
7
|
catch(ctx: {
|
|
5
8
|
error: any;
|
|
6
9
|
}): void;
|
|
7
10
|
};
|
|
8
|
-
/**
|
|
9
|
-
* ensures that a oclif command or hook exits
|
|
10
|
-
*/
|
|
11
11
|
export default _default;
|
package/lib/hook.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
/// <reference types="mocha" />
|
|
2
2
|
import { Interfaces } from '@oclif/core';
|
|
3
3
|
import { loadConfig } from './load-config';
|
|
4
|
-
declare 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
4
|
/**
|
|
12
5
|
* tests a oclif hook
|
|
13
6
|
*
|
|
@@ -19,4 +12,11 @@ declare const _default: (event: string, hookOpts?: Record<string, unknown>, opti
|
|
|
19
12
|
* @param {string} event hook to run
|
|
20
13
|
* @param {object} hookOpts options to pass to hook. Config object will be passed automatically.
|
|
21
14
|
*/
|
|
15
|
+
declare const _default: (event: string, hookOpts?: Record<string, unknown>, options?: loadConfig.Options) => {
|
|
16
|
+
run(ctx: {
|
|
17
|
+
config: Interfaces.Config;
|
|
18
|
+
expectation: string;
|
|
19
|
+
returned: unknown;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
};
|
|
22
22
|
export default _default;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { expect, FancyTypes } from 'fancy-test';
|
|
3
|
-
import { command } from './command';
|
|
1
|
+
/// <reference types="sinon" />
|
|
4
2
|
import { loadConfig } from './load-config';
|
|
5
|
-
export declare const test:
|
|
3
|
+
export declare const test: import("fancy-test/lib/types").Base<import("fancy-test/lib/types").Context, {
|
|
6
4
|
skip: {
|
|
7
5
|
output: unknown;
|
|
8
6
|
args: [];
|
|
@@ -15,7 +13,7 @@ export declare const test: FancyTypes.Base<FancyTypes.Context, {
|
|
|
15
13
|
} & {
|
|
16
14
|
retries: {
|
|
17
15
|
output: unknown;
|
|
18
|
-
args: [
|
|
16
|
+
args: any[];
|
|
19
17
|
};
|
|
20
18
|
} & {
|
|
21
19
|
catch: {
|
|
@@ -31,14 +29,14 @@ export declare const test: FancyTypes.Base<FancyTypes.Context, {
|
|
|
31
29
|
output: unknown;
|
|
32
30
|
args: [env: {
|
|
33
31
|
[k: string]: string | null | undefined;
|
|
34
|
-
}, opts?:
|
|
32
|
+
}, opts?: import("fancy-test/lib/types").EnvOptions | undefined];
|
|
35
33
|
};
|
|
36
34
|
} & {
|
|
37
35
|
stub: {
|
|
38
36
|
output: {
|
|
39
|
-
|
|
37
|
+
sandbox: import("sinon").SinonSandbox;
|
|
40
38
|
};
|
|
41
|
-
args: [object: any, path: any,
|
|
39
|
+
args: [object: any, path: any, fn: (stub: import("sinon").SinonStub<any[], any>) => import("sinon").SinonStub<any[], any>];
|
|
42
40
|
};
|
|
43
41
|
} & {
|
|
44
42
|
stdin: {
|
|
@@ -70,7 +68,7 @@ export declare const test: FancyTypes.Base<FancyTypes.Context, {
|
|
|
70
68
|
output: {
|
|
71
69
|
nock: number;
|
|
72
70
|
};
|
|
73
|
-
args: [host: string, options:
|
|
71
|
+
args: [host: string, options: import("fancy-test/lib/types").NockOptions | import("fancy-test/lib/types").NockCallback, cb?: import("fancy-test/lib/types").NockCallback | undefined];
|
|
74
72
|
};
|
|
75
73
|
} & {
|
|
76
74
|
timeout: {
|
|
@@ -113,4 +111,6 @@ export declare const test: FancyTypes.Base<FancyTypes.Context, {
|
|
|
113
111
|
};
|
|
114
112
|
}>;
|
|
115
113
|
export default test;
|
|
116
|
-
export {
|
|
114
|
+
export { Config } from '@oclif/core';
|
|
115
|
+
export { expect, FancyTypes } from 'fancy-test';
|
|
116
|
+
export { command } from './command';
|
package/lib/index.js
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a, _b;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.command = exports.
|
|
4
|
+
exports.command = exports.FancyTypes = exports.expect = exports.Config = exports.test = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
-
const
|
|
7
|
-
const core_1 = require("@oclif/core");
|
|
8
|
-
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return core_1.Config; } });
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
9
7
|
const fancy_test_1 = require("fancy-test");
|
|
10
|
-
Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return fancy_test_1.expect; } });
|
|
11
|
-
Object.defineProperty(exports, "FancyTypes", { enumerable: true, get: function () { return fancy_test_1.FancyTypes; } });
|
|
12
8
|
const command_1 = require("./command");
|
|
13
|
-
Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_1.command; } });
|
|
14
9
|
const exit_1 = tslib_1.__importDefault(require("./exit"));
|
|
15
10
|
const hook_1 = tslib_1.__importDefault(require("./hook"));
|
|
16
11
|
const load_config_1 = require("./load-config");
|
|
17
12
|
function traverseFilePathUntil(filename, predicate) {
|
|
18
13
|
let current = filename;
|
|
19
14
|
while (!predicate(current)) {
|
|
20
|
-
current =
|
|
15
|
+
current = (0, node_path_1.dirname)(current);
|
|
21
16
|
}
|
|
22
17
|
return current;
|
|
23
18
|
}
|
|
@@ -31,3 +26,10 @@ exports.test = fancy_test_1.fancy
|
|
|
31
26
|
.register('hook', hook_1.default)
|
|
32
27
|
.env({ NODE_ENV: 'test' });
|
|
33
28
|
exports.default = exports.test;
|
|
29
|
+
var core_1 = require("@oclif/core");
|
|
30
|
+
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return core_1.Config; } });
|
|
31
|
+
var fancy_test_2 = require("fancy-test");
|
|
32
|
+
Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return fancy_test_2.expect; } });
|
|
33
|
+
Object.defineProperty(exports, "FancyTypes", { enumerable: true, get: function () { return fancy_test_2.FancyTypes; } });
|
|
34
|
+
var command_2 = require("./command");
|
|
35
|
+
Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_2.command; } });
|
package/lib/load-config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/test",
|
|
3
3
|
"description": "test helpers for oclif components",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.7-beta.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/test/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@oclif/core": "^
|
|
9
|
-
"fancy-test": "^
|
|
8
|
+
"@oclif/core": "^3.0.0-beta.17",
|
|
9
|
+
"fancy-test": "^3.0.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/chai": "^4.3.6",
|
|
13
|
-
"@types/mocha": "^
|
|
14
|
-
"@types/node": "^
|
|
13
|
+
"@types/mocha": "^10",
|
|
14
|
+
"@types/node": "^18",
|
|
15
15
|
"chai": "^4.3.8",
|
|
16
|
-
"eslint": "^
|
|
17
|
-
"eslint-config-oclif": "^
|
|
18
|
-
"eslint-config-oclif-typescript": "^
|
|
16
|
+
"eslint": "^8.49.0",
|
|
17
|
+
"eslint-config-oclif": "^5.0.0",
|
|
18
|
+
"eslint-config-oclif-typescript": "^2.0.1",
|
|
19
19
|
"globby": "^11.0.1",
|
|
20
|
-
"mocha": "^
|
|
20
|
+
"mocha": "^10",
|
|
21
21
|
"nock": "^13.3.3",
|
|
22
22
|
"shx": "^0.3.3",
|
|
23
|
-
"ts-node": "^9.
|
|
24
|
-
"
|
|
23
|
+
"ts-node": "^10.9.1",
|
|
24
|
+
"tslib": "^2.6.2",
|
|
25
|
+
"typescript": "^5"
|
|
25
26
|
},
|
|
26
27
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
28
|
+
"node": ">=18.0.0"
|
|
28
29
|
},
|
|
29
30
|
"files": [
|
|
30
31
|
"/lib"
|
|
@@ -38,11 +39,11 @@
|
|
|
38
39
|
"repository": "oclif/test",
|
|
39
40
|
"scripts": {
|
|
40
41
|
"build": "shx rm -rf lib && tsc",
|
|
41
|
-
"lint": "eslint . --ext .ts
|
|
42
|
+
"lint": "eslint . --ext .ts",
|
|
42
43
|
"posttest": "yarn lint",
|
|
43
44
|
"prepublishOnly": "yarn run build",
|
|
44
45
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
45
46
|
"pretest": "yarn build --noEmit && tsc -p test --noEmit"
|
|
46
47
|
},
|
|
47
48
|
"types": "lib/index.d.ts"
|
|
48
|
-
}
|
|
49
|
+
}
|