@servicetitan/startup-jest 1.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.
package/bin/index.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ const jest = require('../dist');
4
+
5
+ (function () {
6
+ // eslint-disable-next-line no-console
7
+ jest.runJestCli().catch(e => console.error(e));
8
+ })();
@@ -0,0 +1,2 @@
1
+ export * from './jest';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
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);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
@@ -0,0 +1,2 @@
1
+ export declare function runJestCli(): Promise<void>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jest/index.ts"],"names":[],"mappings":"AAIA,wBAAgB,UAAU,kBAkBzB"}
@@ -0,0 +1,33 @@
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];
26
+ }
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();
31
+ }
32
+ exports.runJestCli = runJestCli;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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;QACzB,WAAW,GAAG,CAAC,QAAQ,CAAC,cAAwB,CAAC,CAAC;KACrD;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"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@servicetitan/startup-jest",
3
+ "version": "1.1.0",
4
+ "description": "",
5
+ "homepage": "https://docs.st.dev/docs/frontend/startup",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/servicetitan/anvil-uikit-contrib.git",
9
+ "directory": "packages/startup-jest"
10
+ },
11
+ "main": "./dist/index.js",
12
+ "typings": "./dist/index.d.ts",
13
+ "files": [
14
+ "bin",
15
+ "dist",
16
+ "src",
17
+ "tsconfig.json"
18
+ ],
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
+ "peerDependencies": {
26
+ "@servicetitan/startup": ">=21.10.0"
27
+ },
28
+ "dependencies": {
29
+ "yargs": "~17.7.1"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "cli": {
35
+ "webpack": false
36
+ },
37
+ "gitHead": "2eb88c648e1c071af5a9311683ba186261e27e54"
38
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './jest';
@@ -0,0 +1,23 @@
1
+ import { Arguments, argv } from 'yargs';
2
+ import { Tests } from '@servicetitan/startup/dist/cli/commands/tests';
3
+ import { toArray } from '@servicetitan/startup/dist/utils';
4
+
5
+ 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();
23
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@servicetitan/startup/tsconfig/base",
3
+ "compilerOptions": {
4
+ "module": "commonjs",
5
+ "outDir": "dist",
6
+ "rootDir": "src"
7
+ },
8
+ "include": ["src/**/*"],
9
+ "exclude": ["src/**/__tests__/**/*"]
10
+ }