@oclif/test 3.2.2 → 3.2.5

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/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="sinon" />
2
+ import * as fancyTest from 'fancy-test';
2
3
  import { loadConfig } from './load-config';
3
- export declare const test: import("fancy-test").Fancy<import("fancy-test/lib/types").Context, {
4
+ export declare const test: fancyTest.FancyTypes.Base<fancyTest.FancyTypes.Context, {
4
5
  skip: {
5
6
  output: unknown;
6
7
  args: [];
@@ -29,7 +30,7 @@ export declare const test: import("fancy-test").Fancy<import("fancy-test/lib/typ
29
30
  output: unknown;
30
31
  args: [env: {
31
32
  [k: string]: string | null | undefined;
32
- }, opts?: import("fancy-test/lib/types").EnvOptions | undefined];
33
+ }, opts?: fancyTest.FancyTypes.EnvOptions | undefined];
33
34
  };
34
35
  } & {
35
36
  stub: {
@@ -68,7 +69,7 @@ export declare const test: import("fancy-test").Fancy<import("fancy-test/lib/typ
68
69
  output: {
69
70
  nock: number;
70
71
  };
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];
72
+ args: [host: string, options: fancyTest.FancyTypes.NockOptions | fancyTest.FancyTypes.NockCallback, cb?: fancyTest.FancyTypes.NockCallback | undefined];
72
73
  };
73
74
  } & {
74
75
  timeout: {
package/lib/index.js CHANGED
@@ -1,10 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.expect = exports.FancyTypes = exports.Config = exports.command = exports.test = void 0;
7
- const fancy_test_1 = require("fancy-test");
30
+ const fancyTest = __importStar(require("fancy-test"));
8
31
  const node_path_1 = require("node:path");
9
32
  const command_1 = require("./command");
10
33
  const exit_1 = __importDefault(require("./exit"));
@@ -17,11 +40,12 @@ function traverseFilePathUntil(filename, predicate) {
17
40
  }
18
41
  return current;
19
42
  }
20
- // Update to path.dirname(url.fileURLToPath(import.meta.url)) whenever we update tsconfig target to ES2020
43
+ // Update to path.dirname(url.fileURLToPath(import.meta.url)) whenever we migrate to ESM
21
44
  /* eslint-disable unicorn/prefer-module */
22
45
  load_config_1.loadConfig.root = traverseFilePathUntil(require.main?.path ?? module.path, (p) => !(p.includes('node_modules') || p.includes('.pnpm') || p.includes('.yarn')));
23
46
  /* eslint-enable unicorn/prefer-module */
24
- exports.test = fancy_test_1.fancy
47
+ // Using a named export to import fancy causes this issue: https://github.com/oclif/test/issues/516
48
+ exports.test = fancyTest.fancy
25
49
  .register('loadConfig', load_config_1.loadConfig)
26
50
  .register('command', command_1.command)
27
51
  .register('exit', exit_1.default)
@@ -32,6 +56,6 @@ var command_2 = require("./command");
32
56
  Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_2.command; } });
33
57
  var core_1 = require("@oclif/core");
34
58
  Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return core_1.Config; } });
35
- var fancy_test_2 = require("fancy-test");
36
- Object.defineProperty(exports, "FancyTypes", { enumerable: true, get: function () { return fancy_test_2.FancyTypes; } });
37
- Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return fancy_test_2.expect; } });
59
+ var fancy_test_1 = require("fancy-test");
60
+ Object.defineProperty(exports, "FancyTypes", { enumerable: true, get: function () { return fancy_test_1.FancyTypes; } });
61
+ Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return fancy_test_1.expect; } });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@oclif/test",
3
3
  "description": "test helpers for oclif components",
4
- "version": "3.2.2",
4
+ "version": "3.2.5",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/test/issues",
7
7
  "dependencies": {
8
8
  "@oclif/core": "^3.23.0",
9
9
  "chai": "^4.4.1",
10
- "fancy-test": "^3.0.11"
10
+ "fancy-test": "^3.0.13"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@commitlint/config-conventional": "^18.6.2",
@@ -17,18 +17,17 @@
17
17
  "@types/node": "^18",
18
18
  "commitlint": "^18.6.1",
19
19
  "eslint": "^8.57.0",
20
- "eslint-config-oclif": "^5.0.3",
21
- "eslint-config-oclif-typescript": "^3.0.48",
20
+ "eslint-config-oclif": "^5.1.1",
21
+ "eslint-config-oclif-typescript": "^3.1.2",
22
22
  "eslint-config-prettier": "^9.1.0",
23
- "globby": "^11.0.1",
24
- "husky": "^8.0.3",
23
+ "husky": "^9.0.3",
25
24
  "lint-staged": "^15.2.2",
26
25
  "mocha": "^10",
27
26
  "nock": "^13.5.4",
28
27
  "prettier": "^3.2.5",
29
28
  "shx": "^0.3.3",
30
29
  "ts-node": "^10.9.2",
31
- "typescript": "^5"
30
+ "typescript": "^5.4.2"
32
31
  },
33
32
  "engines": {
34
33
  "node": ">=18.0.0"
@@ -47,7 +46,7 @@
47
46
  "build": "shx rm -rf lib && tsc",
48
47
  "lint": "eslint . --ext .ts",
49
48
  "posttest": "yarn lint",
50
- "prepare": "husky install",
49
+ "prepare": "husky && yarn build",
51
50
  "prepublishOnly": "yarn run build",
52
51
  "pretest": "yarn build --noEmit && tsc -p test --noEmit",
53
52
  "test": "mocha --forbid-only \"test/**/*.test.ts\""