@servicetitan/startup-jest 1.2.0 → 1.4.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/bin/index.js CHANGED
@@ -3,6 +3,11 @@
3
3
  const jest = require('../dist');
4
4
 
5
5
  (function () {
6
- // eslint-disable-next-line no-console
7
- jest.runJestCli().catch(e => console.error(e));
6
+ try {
7
+ jest.runJestCli()
8
+ } catch (e) {
9
+ // eslint-disable-next-line no-console
10
+ console.error(String(e));
11
+ process.exitCode = 1;
12
+ }
8
13
  })();
package/dist/index.js CHANGED
@@ -1,18 +1,20 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./jest"), exports);
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./jest"), exports);
6
+ function _export_star(from, to) {
7
+ Object.keys(from).forEach(function(k) {
8
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
+ Object.defineProperty(to, k, {
10
+ enumerable: true,
11
+ get: function() {
12
+ return from[k];
13
+ }
14
+ });
15
+ }
16
+ });
17
+ return from;
18
+ }
19
+
18
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './jest';\n"],"names":[],"mappings":";;;;qBAAc"}
@@ -1,2 +1,2 @@
1
- export declare function runJestCli(): Promise<void>;
1
+ export declare function runJestCli(): void;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jest/index.ts"],"names":[],"mappings":"AAIA,wBAAgB,UAAU,kBAkBzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jest/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,SAKzB"}
@@ -1,33 +1,21 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.runJestCli = void 0;
15
- const yargs_1 = require("yargs");
16
- const tests_1 = require("@servicetitan/startup/dist/cli/commands/tests");
17
- const utils_1 = require("@servicetitan/startup/dist/utils");
18
- function runJestCli() {
19
- // eslint-disable-next-line @typescript-eslint/naming-convention
20
- const _a = yargs_1.argv, { $0, _ } = _a, argvSync = __rest(_a, ["$0", "_"]);
21
- // Fix reporters, because Rider sends it as string, but array is required by Jest
22
- argvSync.reporters = (0, utils_1.toArray)(argvSync.reporters);
23
- let cliArgument = _;
24
- if (argvSync.runTestsByPath) {
25
- cliArgument = [argvSync.runTestsByPath];
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "runJestCli", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return runJestCli;
26
9
  }
27
- const jestCommand = new tests_1.Tests(Object.assign({ $0,
28
- // eslint-disable-next-line @typescript-eslint/naming-convention
29
- _: cliArgument }, argvSync));
30
- return jestCommand.execute();
10
+ });
11
+ const _child_process = require("child_process");
12
+ function runJestCli() {
13
+ const args = process.argv.slice(2); // argv[0] = Node executable, argv[1] = script path
14
+ const command = `npx startup test ${args.join(' ')}`;
15
+ console.log(`> ${command}`); // eslint-disable-line no-console
16
+ (0, _child_process.execSync)(command, {
17
+ stdio: 'inherit'
18
+ });
31
19
  }
32
- exports.runJestCli = runJestCli;
20
+
33
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jest/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iCAAwC;AACxC,yEAAsE;AACtE,4DAA2D;AAE3D,SAAgB,UAAU;IACtB,gEAAgE;IAChE,MAAM,KAAyB,YAAiB,EAA1C,EAAE,EAAE,EAAE,CAAC,OAAmC,EAA9B,QAAQ,cAApB,WAAsB,CAAoB,CAAC;IAEjD,iFAAiF;IACjF,QAAQ,CAAC,SAAS,GAAG,IAAA,eAAO,EAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEjD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,QAAQ,CAAC,cAAc,EAAE,CAAC;QAC1B,WAAW,GAAG,CAAC,QAAQ,CAAC,cAAwB,CAAC,CAAC;IACtD,CAAC;IACD,MAAM,WAAW,GAAG,IAAI,aAAK,iBACzB,EAAE;QACF,gEAAgE;QAChE,CAAC,EAAE,WAAW,IACX,QAAQ,EACb,CAAC;IACH,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;AACjC,CAAC;AAlBD,gCAkBC"}
1
+ {"version":3,"sources":["../../src/jest/index.ts"],"sourcesContent":["import { execSync } from 'child_process';\n\nexport function runJestCli() {\n const args = process.argv.slice(2); // argv[0] = Node executable, argv[1] = script path\n const command = `npx startup test ${args.join(' ')}`;\n console.log(`> ${command}`); // eslint-disable-line no-console\n execSync(command, { stdio: 'inherit' });\n}\n"],"names":["runJestCli","args","process","argv","slice","command","join","console","log","execSync","stdio"],"mappings":";;;;+BAEgBA;;;eAAAA;;;+BAFS;AAElB,SAASA;IACZ,MAAMC,OAAOC,QAAQC,IAAI,CAACC,KAAK,CAAC,IAAI,mDAAmD;IACvF,MAAMC,UAAU,CAAC,iBAAiB,EAAEJ,KAAKK,IAAI,CAAC,MAAM;IACpDC,QAAQC,GAAG,CAAC,CAAC,EAAE,EAAEH,SAAS,GAAG,iCAAiC;IAC9DI,IAAAA,uBAAQ,EAACJ,SAAS;QAAEK,OAAO;IAAU;AACzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/startup-jest",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/startup",
6
6
  "repository": {
@@ -17,22 +17,14 @@
17
17
  "tsconfig.json"
18
18
  ],
19
19
  "bin": "./bin/index.js",
20
- "devDependencies": {
21
- "@types/stylelint": "~13.13.3",
22
- "@types/webpack-dev-server": "~3.11.5",
23
- "@types/yargs": "~17.0.22"
24
- },
25
20
  "peerDependencies": {
26
21
  "@servicetitan/startup": ">=21.10.0"
27
22
  },
28
- "dependencies": {
29
- "yargs": "~17.7.1"
30
- },
31
23
  "publishConfig": {
32
24
  "access": "public"
33
25
  },
34
26
  "cli": {
35
27
  "webpack": false
36
28
  },
37
- "gitHead": "d1a0e51ceead74eb9576aa0080375a2a89f576a7"
29
+ "gitHead": "3dab3310534a39aaacb0069e1d377579fe0a7fab"
38
30
  }
package/src/jest/index.ts CHANGED
@@ -1,23 +1,8 @@
1
- import { Arguments, argv } from 'yargs';
2
- import { Tests } from '@servicetitan/startup/dist/cli/commands/tests';
3
- import { toArray } from '@servicetitan/startup/dist/utils';
1
+ import { execSync } from 'child_process';
4
2
 
5
3
  export function runJestCli() {
6
- // eslint-disable-next-line @typescript-eslint/naming-convention
7
- const { $0, _, ...argvSync } = argv as Arguments;
8
-
9
- // Fix reporters, because Rider sends it as string, but array is required by Jest
10
- argvSync.reporters = toArray(argvSync.reporters);
11
-
12
- let cliArgument = _;
13
- if (argvSync.runTestsByPath) {
14
- cliArgument = [argvSync.runTestsByPath as string];
15
- }
16
- const jestCommand = new Tests({
17
- $0,
18
- // eslint-disable-next-line @typescript-eslint/naming-convention
19
- _: cliArgument,
20
- ...argvSync,
21
- });
22
- return jestCommand.execute();
4
+ const args = process.argv.slice(2); // argv[0] = Node executable, argv[1] = script path
5
+ const command = `npx startup test ${args.join(' ')}`;
6
+ console.log(`> ${command}`); // eslint-disable-line no-console
7
+ execSync(command, { stdio: 'inherit' });
23
8
  }
package/tsconfig.json CHANGED
@@ -6,6 +6,5 @@
6
6
  "outDir": "dist",
7
7
  "rootDir": "src"
8
8
  },
9
- "include": ["src/**/*"],
10
- "exclude": ["src/**/__tests__/**/*"]
9
+ "include": ["src/**/*"]
11
10
  }