@oclif/test 2.3.33 → 2.4.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.
Files changed (2) hide show
  1. package/lib/index.js +15 -3
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
+ var _a, _b;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.command = exports.Config = exports.FancyTypes = exports.expect = exports.test = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const path_1 = tslib_1.__importDefault(require("path"));
4
7
  const core_1 = require("@oclif/core");
5
8
  Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return core_1.Config; } });
6
9
  const fancy_test_1 = require("fancy-test");
@@ -8,10 +11,19 @@ Object.defineProperty(exports, "expect", { enumerable: true, get: function () {
8
11
  Object.defineProperty(exports, "FancyTypes", { enumerable: true, get: function () { return fancy_test_1.FancyTypes; } });
9
12
  const command_1 = require("./command");
10
13
  Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_1.command; } });
11
- const exit_1 = require("./exit");
12
- const hook_1 = require("./hook");
14
+ const exit_1 = tslib_1.__importDefault(require("./exit"));
15
+ const hook_1 = tslib_1.__importDefault(require("./hook"));
13
16
  const load_config_1 = require("./load-config");
14
- load_config_1.loadConfig.root = module.parent.filename;
17
+ function traverseFilePathUntil(filename, predicate) {
18
+ let current = filename;
19
+ while (!predicate(current)) {
20
+ current = path_1.default.dirname(current);
21
+ }
22
+ return current;
23
+ }
24
+ // Update to path.dirname(url.fileURLToPath(import.meta.url)) whenever we update tsconfig target to ES2020
25
+ // eslint-disable-next-line unicorn/prefer-module
26
+ load_config_1.loadConfig.root = traverseFilePathUntil((_b = (_a = require.main) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : module.path, p => !p.includes('node_modules'));
15
27
  exports.test = fancy_test_1.fancy
16
28
  .register('loadConfig', load_config_1.loadConfig)
17
29
  .register('command', command_1.command)
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@oclif/test",
3
3
  "description": "test helpers for oclif components",
4
- "version": "2.3.33",
4
+ "version": "2.4.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/test/issues",
7
7
  "dependencies": {
8
- "@oclif/core": "^2.9.4",
8
+ "@oclif/core": "^2.11.1",
9
9
  "fancy-test": "^2.0.31"
10
10
  },
11
11
  "devDependencies": {