@atls/code-test 0.0.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/config.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/dist/jest.config.d.ts +88 -0
- package/dist/jest.config.js +41 -0
- package/dist/jest.d.ts +11 -0
- package/dist/jest.js +18 -0
- package/package.json +42 -0
- package/resolver.js +7 -0
package/config.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
testRegex: '\\.test\\.(ts|tsx)$',
|
|
3
|
+
modulePathIgnorePatterns: ['dist'],
|
|
4
|
+
snapshotSerializers: [require.resolve('@emotion/jest/serializer')],
|
|
5
|
+
moduleNameMapper: {
|
|
6
|
+
'^.+\\.(jpg|jpeg|gif|png|mp4|mkv|avi|webm|swf|wav|mid)$': 'jest-static-stubs/$1',
|
|
7
|
+
},
|
|
8
|
+
globals: {
|
|
9
|
+
'ts-jest': {
|
|
10
|
+
tsConfig: require.resolve('@atlantis-lab/tsconfig/tsconfig.base.json'),
|
|
11
|
+
diagnostics: false,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
transform: {
|
|
15
|
+
'^.+\\.[tj]sx?$': require.resolve('ts-jest'),
|
|
16
|
+
},
|
|
17
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './jest';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./jest"), exports);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare const unitConfig: {
|
|
2
|
+
testRegex: string;
|
|
3
|
+
modulePathIgnorePatterns: string[];
|
|
4
|
+
snapshotSerializers: string[];
|
|
5
|
+
moduleNameMapper: {
|
|
6
|
+
'^.+\\.(jpg|jpeg|gif|png|mp4|mkv|avi|webm|swf|wav|mid)$': string;
|
|
7
|
+
};
|
|
8
|
+
globals: {
|
|
9
|
+
'ts-jest': {
|
|
10
|
+
tsconfig: {
|
|
11
|
+
lib: string[];
|
|
12
|
+
declaration: boolean;
|
|
13
|
+
emitDecoratorMetadata: boolean;
|
|
14
|
+
experimentalDecorators: boolean;
|
|
15
|
+
esModuleInterop: boolean;
|
|
16
|
+
forceConsistentCasingInFileNames: boolean;
|
|
17
|
+
importHelpers: boolean;
|
|
18
|
+
isolatedModules: boolean;
|
|
19
|
+
module: string;
|
|
20
|
+
moduleResolution: string;
|
|
21
|
+
noFallthroughCasesInSwitch: boolean;
|
|
22
|
+
noImplicitAny: boolean;
|
|
23
|
+
noImplicitReturns: boolean;
|
|
24
|
+
noImplicitThis: boolean;
|
|
25
|
+
noUnusedLocals: boolean;
|
|
26
|
+
noUnusedParameters: boolean;
|
|
27
|
+
pretty: boolean;
|
|
28
|
+
removeComments: boolean;
|
|
29
|
+
resolveJsonModule: boolean;
|
|
30
|
+
strict: boolean;
|
|
31
|
+
strictPropertyInitialization: boolean;
|
|
32
|
+
sourceMap: boolean;
|
|
33
|
+
target: string;
|
|
34
|
+
jsx: string;
|
|
35
|
+
outDir: string;
|
|
36
|
+
};
|
|
37
|
+
diagnostics: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
transform: {
|
|
41
|
+
'^.+\\.[tj]sx?$': string;
|
|
42
|
+
};
|
|
43
|
+
resolver: string;
|
|
44
|
+
};
|
|
45
|
+
export declare const integrationConfig: {
|
|
46
|
+
testRegex: string;
|
|
47
|
+
modulePathIgnorePatterns: string[];
|
|
48
|
+
snapshotSerializers: string[];
|
|
49
|
+
moduleNameMapper: {
|
|
50
|
+
'^.+\\.(jpg|jpeg|gif|png|mp4|mkv|avi|webm|swf|wav|mid)$': string;
|
|
51
|
+
};
|
|
52
|
+
globals: {
|
|
53
|
+
'ts-jest': {
|
|
54
|
+
tsconfig: {
|
|
55
|
+
lib: string[];
|
|
56
|
+
declaration: boolean;
|
|
57
|
+
emitDecoratorMetadata: boolean;
|
|
58
|
+
experimentalDecorators: boolean;
|
|
59
|
+
esModuleInterop: boolean;
|
|
60
|
+
forceConsistentCasingInFileNames: boolean;
|
|
61
|
+
importHelpers: boolean;
|
|
62
|
+
isolatedModules: boolean;
|
|
63
|
+
module: string;
|
|
64
|
+
moduleResolution: string;
|
|
65
|
+
noFallthroughCasesInSwitch: boolean;
|
|
66
|
+
noImplicitAny: boolean;
|
|
67
|
+
noImplicitReturns: boolean;
|
|
68
|
+
noImplicitThis: boolean;
|
|
69
|
+
noUnusedLocals: boolean;
|
|
70
|
+
noUnusedParameters: boolean;
|
|
71
|
+
pretty: boolean;
|
|
72
|
+
removeComments: boolean;
|
|
73
|
+
resolveJsonModule: boolean;
|
|
74
|
+
strict: boolean;
|
|
75
|
+
strictPropertyInitialization: boolean;
|
|
76
|
+
sourceMap: boolean;
|
|
77
|
+
target: string;
|
|
78
|
+
jsx: string;
|
|
79
|
+
outDir: string;
|
|
80
|
+
};
|
|
81
|
+
diagnostics: boolean;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
transform: {
|
|
85
|
+
'^.+\\.[tj]sx?$': string;
|
|
86
|
+
};
|
|
87
|
+
resolver: string;
|
|
88
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.integrationConfig = exports.unitConfig = void 0;
|
|
4
|
+
const code_typescript_1 = require("@atls/code-typescript");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
exports.unitConfig = {
|
|
7
|
+
testRegex: '\\.test\\.(ts|tsx)$',
|
|
8
|
+
modulePathIgnorePatterns: ['dist', 'integration'],
|
|
9
|
+
snapshotSerializers: [require.resolve('@emotion/jest/serializer')],
|
|
10
|
+
moduleNameMapper: {
|
|
11
|
+
'^.+\\.(jpg|jpeg|gif|png|mp4|mkv|avi|webm|swf|wav|mid)$': 'jest-static-stubs/$1',
|
|
12
|
+
},
|
|
13
|
+
globals: {
|
|
14
|
+
'ts-jest': {
|
|
15
|
+
tsconfig: code_typescript_1.base.compilerOptions,
|
|
16
|
+
diagnostics: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
transform: {
|
|
20
|
+
'^.+\\.[tj]sx?$': require.resolve('ts-jest'),
|
|
21
|
+
},
|
|
22
|
+
resolver: (0, path_1.join)(__dirname, '../resolver.js'),
|
|
23
|
+
};
|
|
24
|
+
exports.integrationConfig = {
|
|
25
|
+
testRegex: '/integration/.*\\.test\\.(ts|tsx)$',
|
|
26
|
+
modulePathIgnorePatterns: ['dist'],
|
|
27
|
+
snapshotSerializers: [require.resolve('@emotion/jest/serializer')],
|
|
28
|
+
moduleNameMapper: {
|
|
29
|
+
'^.+\\.(jpg|jpeg|gif|png|mp4|mkv|avi|webm|swf|wav|mid)$': 'jest-static-stubs/$1',
|
|
30
|
+
},
|
|
31
|
+
globals: {
|
|
32
|
+
'ts-jest': {
|
|
33
|
+
tsconfig: code_typescript_1.base.compilerOptions,
|
|
34
|
+
diagnostics: false,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
transform: {
|
|
38
|
+
'^.+\\.[tj]sx?$': require.resolve('ts-jest'),
|
|
39
|
+
},
|
|
40
|
+
resolver: (0, path_1.join)(__dirname, '../resolver.js'),
|
|
41
|
+
};
|
package/dist/jest.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AggregatedResult } from '@jest/test-result';
|
|
2
|
+
import { Config } from '@jest/types';
|
|
3
|
+
declare const unit: (project: string, options?: Partial<Config.Argv> | undefined, files?: string[] | undefined) => Promise<{
|
|
4
|
+
results: AggregatedResult;
|
|
5
|
+
globalConfig: Config.GlobalConfig;
|
|
6
|
+
}>;
|
|
7
|
+
declare const integration: (project: string, options?: Partial<Config.Argv> | undefined, files?: string[] | undefined) => Promise<{
|
|
8
|
+
results: AggregatedResult;
|
|
9
|
+
globalConfig: Config.GlobalConfig;
|
|
10
|
+
}>;
|
|
11
|
+
export { unit, integration };
|
package/dist/jest.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.integration = exports.unit = void 0;
|
|
4
|
+
const core_1 = require("@jest/core");
|
|
5
|
+
const jest_config_1 = require("./jest.config");
|
|
6
|
+
const jest_config_2 = require("./jest.config");
|
|
7
|
+
const unit = async (project, options, files) => {
|
|
8
|
+
process.env.TS_JEST_DISABLE_VER_CHECKER = 'true';
|
|
9
|
+
const argv = Object.assign({ rootDir: project, ci: false, detectLeaks: false, detectOpenHandles: false, errorOnDeprecated: false, listTests: false, passWithNoTests: true, runTestsByPath: false, testLocationInResults: true, config: JSON.stringify(jest_config_2.unitConfig), maxConcurrency: 5, notifyMode: 'failure-change', _: files || [] }, options);
|
|
10
|
+
return (0, core_1.runCLI)(argv, [project]);
|
|
11
|
+
};
|
|
12
|
+
exports.unit = unit;
|
|
13
|
+
const integration = async (project, options, files) => {
|
|
14
|
+
process.env.TS_JEST_DISABLE_VER_CHECKER = 'true';
|
|
15
|
+
const argv = Object.assign({ rootDir: project, ci: false, detectLeaks: false, detectOpenHandles: false, errorOnDeprecated: false, listTests: false, passWithNoTests: true, runTestsByPath: false, testLocationInResults: true, config: JSON.stringify(jest_config_1.integrationConfig), maxConcurrency: 5, notifyMode: 'failure-change', _: files || [] }, options);
|
|
16
|
+
return (0, core_1.runCLI)(argv, [project]);
|
|
17
|
+
};
|
|
18
|
+
exports.integration = integration;
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atls/code-test",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"license": "BSD-3-Clause",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"config.js",
|
|
9
|
+
"resolver.js"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "builder build library",
|
|
13
|
+
"postpack": "rm -rf dist",
|
|
14
|
+
"prepack": "yarn run build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@atls/tools-builder": "0.0.0",
|
|
18
|
+
"@types/jest": "^27.0.1",
|
|
19
|
+
"@types/node": "^16.7.10",
|
|
20
|
+
"jest-haste-map": "^27.1.0",
|
|
21
|
+
"typescript": "^4.4.2"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@atls/code-typescript": "0.0.5",
|
|
25
|
+
"@emotion/jest": "^11.3.0",
|
|
26
|
+
"@jest/core": "^27.1.0",
|
|
27
|
+
"@jest/test-result": "^27.1.0",
|
|
28
|
+
"@jest/types": "^27.1.0",
|
|
29
|
+
"jest-static-stubs": "^0.0.1",
|
|
30
|
+
"ts-jest": "^27.0.5"
|
|
31
|
+
},
|
|
32
|
+
"peerDependenciesMeta": {
|
|
33
|
+
"jest": {
|
|
34
|
+
"optional": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"main": "dist/index.js",
|
|
39
|
+
"typings": "dist/index.d.ts"
|
|
40
|
+
},
|
|
41
|
+
"typings": "dist/index.d.ts"
|
|
42
|
+
}
|