@oclif/test 2.0.2 → 2.1.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/CHANGELOG.md +21 -0
- package/README.md +2 -3
- package/lib/command.js +4 -4
- package/lib/index.js +2 -1
- package/lib/load-config.d.ts +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.1.1](https://github.com/oclif/test/compare/v2.1.0...v2.1.1) (2022-08-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* set NODE_ENV to test ([00af914](https://github.com/oclif/test/commit/00af914ac4e41b95ffc9030d81f69a74aef6b1ad))
|
|
11
|
+
|
|
12
|
+
## [2.1.0](https://github.com/oclif/test/compare/v2.0.3...v2.1.0) (2022-02-10)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* support commands with spaces ([531f8e0](https://github.com/oclif/test/commit/531f8e08e101e084a050410a6d63ac28c3277de9))
|
|
18
|
+
|
|
19
|
+
### [2.0.3](https://github.com/oclif/test/compare/v2.0.2...v2.0.3) (2021-12-08)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* align deps ([742fdb3](https://github.com/oclif/test/commit/742fdb301057fef5762a83ff65b361873f338769))
|
|
25
|
+
|
|
5
26
|
### [2.0.2](https://github.com/oclif/test/compare/v2.0.1...v2.0.2) (2021-12-02)
|
|
6
27
|
|
|
7
28
|
|
package/README.md
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
test helpers for oclif components
|
|
5
5
|
|
|
6
6
|
[](https://npmjs.org/package/@oclif/test)
|
|
7
|
-
[](https://ci.appveyor.com/project/heroku/test/branch/master)
|
|
7
|
+
[](https://circleci.com/gh/oclif/test/tree/main)
|
|
9
8
|
[](https://snyk.io/test/npm/@oclif/test)
|
|
10
9
|
[](https://npmjs.org/package/@oclif/test)
|
|
11
|
-
[](https://github.com/oclif/test/blob/
|
|
10
|
+
[](https://github.com/oclif/test/blob/main/package.json)
|
package/lib/command.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
4
5
|
const load_config_1 = require("./load-config");
|
|
5
6
|
const castArray = (input) => {
|
|
6
7
|
if (input === undefined)
|
|
@@ -10,15 +11,14 @@ const castArray = (input) => {
|
|
|
10
11
|
function command(args, opts = {}) {
|
|
11
12
|
return {
|
|
12
13
|
async run(ctx) {
|
|
13
|
-
// eslint-disable-next-line require-atomic-updates
|
|
14
14
|
if (!ctx.config || opts.reset)
|
|
15
15
|
ctx.config = await (0, load_config_1.loadConfig)(opts).run({});
|
|
16
16
|
args = castArray(args);
|
|
17
17
|
const [id, ...extra] = args;
|
|
18
|
-
|
|
18
|
+
const cmdId = (0, core_1.toStandardizedId)(id, ctx.config);
|
|
19
19
|
ctx.expectation = ctx.expectation || `runs ${args.join(' ')}`;
|
|
20
|
-
await ctx.config.runHook('init', { id, argv: extra });
|
|
21
|
-
await ctx.config.runCommand(
|
|
20
|
+
await ctx.config.runHook('init', { id: cmdId, argv: extra });
|
|
21
|
+
await ctx.config.runCommand(cmdId, extra);
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
}
|
package/lib/index.js
CHANGED
|
@@ -16,5 +16,6 @@ exports.test = fancy_test_1.fancy
|
|
|
16
16
|
.register('loadConfig', load_config_1.loadConfig)
|
|
17
17
|
.register('command', command_1.command)
|
|
18
18
|
.register('exit', exit_1.default)
|
|
19
|
-
.register('hook', hook_1.default)
|
|
19
|
+
.register('hook', hook_1.default)
|
|
20
|
+
.env({ NODE_ENV: 'test' });
|
|
20
21
|
exports.default = exports.test;
|
package/lib/load-config.d.ts
CHANGED
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.
|
|
5
|
-
"author": "
|
|
4
|
+
"version": "2.1.1",
|
|
5
|
+
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/test/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
+
"@oclif/core": "^1.6.4",
|
|
8
9
|
"fancy-test": "^2.0.0"
|
|
9
10
|
},
|
|
10
11
|
"devDependencies": {
|
|
11
|
-
"@oclif/core": "^1.0.5",
|
|
12
12
|
"@types/chai": "^4.1.7",
|
|
13
|
-
"@types/mocha": "^9.
|
|
14
|
-
"@types/node": "^14.0
|
|
13
|
+
"@types/mocha": "^9.1.1",
|
|
14
|
+
"@types/node": "^14.18.0",
|
|
15
15
|
"chai": "^4.2.0",
|
|
16
16
|
"eslint": "^7.32.0",
|
|
17
17
|
"eslint-config-oclif": "^4.0.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"nock": "^13.0.1",
|
|
22
22
|
"shx": "^0.3.3",
|
|
23
23
|
"ts-node": "^9.0.0",
|
|
24
|
-
"typescript": "4.4
|
|
24
|
+
"typescript": "4.6.4"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=12.0.0"
|