@servicetitan/startup-jest 2.0.2 → 2.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jest/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,SAezB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jest/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,SAyBzB"}
@@ -10,11 +10,23 @@ Object.defineProperty(exports, "runJestCli", {
10
10
  });
11
11
  const _child_process = require("child_process");
12
12
  function runJestCli() {
13
+ const shell = process.platform === 'win32'; // on Windows NPM.CMD requires a shell
13
14
  let args = process.argv.slice(2); // argv[0] = Node executable, argv[1] = script path
14
- /*
15
- * Convert --runTestByPath added by webstorm to explicit --runTestsByPath=true so
16
- * the CLI doesn't misinterpret the boolean option.
17
- */ args = args.map((option)=>option === '--runTestsByPath' ? '--runTestsByPath=true' : option);
15
+ args = args.map((option)=>{
16
+ /**
17
+ * Convert --runTestByPath added by WebStorm to explicit --runTestsByPath=true so
18
+ * the CLI doesn't misinterpret the boolean option.
19
+ */ if (option === '--runTestsByPath') {
20
+ return '--runTestsByPath=true';
21
+ }
22
+ /**
23
+ * When using shell, wrap args containing spaces in quotes because execFileSync
24
+ * passes args array to shell as a space-separated string.
25
+ */ if (shell && option.includes(' ')) {
26
+ return `"${option}"`;
27
+ }
28
+ return option;
29
+ });
18
30
  const command = `npx startup test ${args.join(' ')}`;
19
31
  console.log(`> ${command}`); // eslint-disable-line no-console
20
32
  (0, _child_process.execFileSync)('npx', [
@@ -23,7 +35,7 @@ function runJestCli() {
23
35
  ...args
24
36
  ], {
25
37
  stdio: 'inherit',
26
- shell: process.platform === 'win32'
38
+ shell
27
39
  });
28
40
  }
29
41
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/jest/index.ts"],"sourcesContent":["import { execFileSync } from 'child_process';\n\nexport function runJestCli() {\n let args = process.argv.slice(2); // argv[0] = Node executable, argv[1] = script path\n\n /*\n * Convert --runTestByPath added by webstorm to explicit --runTestsByPath=true so\n * the CLI doesn't misinterpret the boolean option.\n */\n args = args.map(option => (option === '--runTestsByPath' ? '--runTestsByPath=true' : option));\n\n const command = `npx startup test ${args.join(' ')}`;\n console.log(`> ${command}`); // eslint-disable-line no-console\n execFileSync('npx', ['startup', 'test', ...args], {\n stdio: 'inherit',\n shell: process.platform === 'win32', // on Windows NPM.CMD requires a shell\n });\n}\n"],"names":["runJestCli","args","process","argv","slice","map","option","command","join","console","log","execFileSync","stdio","shell","platform"],"mappings":";;;;+BAEgBA;;;eAAAA;;;+BAFa;AAEtB,SAASA;IACZ,IAAIC,OAAOC,QAAQC,IAAI,CAACC,KAAK,CAAC,IAAI,mDAAmD;IAErF;;;KAGC,GACDH,OAAOA,KAAKI,GAAG,CAACC,CAAAA,SAAWA,WAAW,qBAAqB,0BAA0BA;IAErF,MAAMC,UAAU,CAAC,iBAAiB,EAAEN,KAAKO,IAAI,CAAC,MAAM;IACpDC,QAAQC,GAAG,CAAC,CAAC,EAAE,EAAEH,SAAS,GAAG,iCAAiC;IAC9DI,IAAAA,2BAAY,EAAC,OAAO;QAAC;QAAW;WAAWV;KAAK,EAAE;QAC9CW,OAAO;QACPC,OAAOX,QAAQY,QAAQ,KAAK;IAChC;AACJ"}
1
+ {"version":3,"sources":["../../src/jest/index.ts"],"sourcesContent":["import { execFileSync } from 'child_process';\n\nexport function runJestCli() {\n const shell = process.platform === 'win32'; // on Windows NPM.CMD requires a shell\n let args = process.argv.slice(2); // argv[0] = Node executable, argv[1] = script path\n\n args = args.map(option => {\n /**\n * Convert --runTestByPath added by WebStorm to explicit --runTestsByPath=true so\n * the CLI doesn't misinterpret the boolean option.\n */\n if (option === '--runTestsByPath') {\n return '--runTestsByPath=true';\n }\n /**\n * When using shell, wrap args containing spaces in quotes because execFileSync\n * passes args array to shell as a space-separated string.\n */\n if (shell && option.includes(' ')) {\n return `\"${option}\"`;\n }\n return option;\n });\n\n const command = `npx startup test ${args.join(' ')}`;\n console.log(`> ${command}`); // eslint-disable-line no-console\n execFileSync('npx', ['startup', 'test', ...args], { stdio: 'inherit', shell });\n}\n"],"names":["runJestCli","shell","process","platform","args","argv","slice","map","option","includes","command","join","console","log","execFileSync","stdio"],"mappings":";;;;+BAEgBA;;;eAAAA;;;+BAFa;AAEtB,SAASA;IACZ,MAAMC,QAAQC,QAAQC,QAAQ,KAAK,SAAS,sCAAsC;IAClF,IAAIC,OAAOF,QAAQG,IAAI,CAACC,KAAK,CAAC,IAAI,mDAAmD;IAErFF,OAAOA,KAAKG,GAAG,CAACC,CAAAA;QACZ;;;SAGC,GACD,IAAIA,WAAW,oBAAoB;YAC/B,OAAO;QACX;QACA;;;SAGC,GACD,IAAIP,SAASO,OAAOC,QAAQ,CAAC,MAAM;YAC/B,OAAO,CAAC,CAAC,EAAED,OAAO,CAAC,CAAC;QACxB;QACA,OAAOA;IACX;IAEA,MAAME,UAAU,CAAC,iBAAiB,EAAEN,KAAKO,IAAI,CAAC,MAAM;IACpDC,QAAQC,GAAG,CAAC,CAAC,EAAE,EAAEH,SAAS,GAAG,iCAAiC;IAC9DI,IAAAA,2BAAY,EAAC,OAAO;QAAC;QAAW;WAAWV;KAAK,EAAE;QAAEW,OAAO;QAAWd;IAAM;AAChF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/startup-jest",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/startup",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "bin": "./bin/index.js",
20
20
  "peerDependencies": {
21
- "@servicetitan/startup": ">=21.10.0"
21
+ "@servicetitan/startup": ">=33.1.1"
22
22
  },
23
23
  "publishConfig": {
24
24
  "access": "public"
@@ -26,5 +26,5 @@
26
26
  "cli": {
27
27
  "webpack": false
28
28
  },
29
- "gitHead": "e5cc4337a19b32de0595e1f23d13029c40b350c2"
29
+ "gitHead": "a44925e37020acb2153c7e10215a31cd22d054c1"
30
30
  }
package/src/jest/index.ts CHANGED
@@ -1,18 +1,28 @@
1
1
  import { execFileSync } from 'child_process';
2
2
 
3
3
  export function runJestCli() {
4
+ const shell = process.platform === 'win32'; // on Windows NPM.CMD requires a shell
4
5
  let args = process.argv.slice(2); // argv[0] = Node executable, argv[1] = script path
5
6
 
6
- /*
7
- * Convert --runTestByPath added by webstorm to explicit --runTestsByPath=true so
8
- * the CLI doesn't misinterpret the boolean option.
9
- */
10
- args = args.map(option => (option === '--runTestsByPath' ? '--runTestsByPath=true' : option));
7
+ args = args.map(option => {
8
+ /**
9
+ * Convert --runTestByPath added by WebStorm to explicit --runTestsByPath=true so
10
+ * the CLI doesn't misinterpret the boolean option.
11
+ */
12
+ if (option === '--runTestsByPath') {
13
+ return '--runTestsByPath=true';
14
+ }
15
+ /**
16
+ * When using shell, wrap args containing spaces in quotes because execFileSync
17
+ * passes args array to shell as a space-separated string.
18
+ */
19
+ if (shell && option.includes(' ')) {
20
+ return `"${option}"`;
21
+ }
22
+ return option;
23
+ });
11
24
 
12
25
  const command = `npx startup test ${args.join(' ')}`;
13
26
  console.log(`> ${command}`); // eslint-disable-line no-console
14
- execFileSync('npx', ['startup', 'test', ...args], {
15
- stdio: 'inherit',
16
- shell: process.platform === 'win32', // on Windows NPM.CMD requires a shell
17
- });
27
+ execFileSync('npx', ['startup', 'test', ...args], { stdio: 'inherit', shell });
18
28
  }