@tsed/cli-plugin-jest 6.1.8 → 6.1.10

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.
@@ -15,16 +15,15 @@ let CliPluginJestModule = class CliPluginJestModule {
15
15
  addScripts() {
16
16
  const runtime = this.runtimes.get();
17
17
  this.packageJson.addScripts({
18
- test: `${runtime.run("test:lint")} && ${runtime.run("test:coverage")} `,
19
- "test:unit": "cross-env NODE_ENV=test jest",
18
+ "test:unit": "cross-env NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest",
20
19
  "test:coverage": `${runtime.run("test:unit")} `
21
20
  });
22
21
  }
23
22
  addDevDependencies() {
24
23
  this.packageJson.addDevDependencies({
25
24
  "@types/jest": "latest",
26
- jest: "latest",
27
- "ts-jest": "latest"
25
+ "@swc/jest": "latest",
26
+ jest: "latest"
28
27
  });
29
28
  }
30
29
  };
@@ -7,7 +7,7 @@ let JestInitHook = class JestInitHook {
7
7
  {
8
8
  title: "Generate files for jest",
9
9
  task: (ctx) => {
10
- return this.rootRenderer.renderAll(["jest.config.js.hbs"], ctx, {
10
+ return this.rootRenderer.renderAll(["jest.config.ts.hbs"], ctx, {
11
11
  templateDir: `${TEMPLATE_DIR}/init`
12
12
  });
13
13
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsed/cli-plugin-jest",
3
3
  "description": "Ts.ED CLI plugin. Add Jest support",
4
- "version": "6.1.8",
4
+ "version": "6.1.10",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -21,9 +21,9 @@
21
21
  "test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
22
22
  },
23
23
  "devDependencies": {
24
- "@tsed/cli": "6.1.8",
25
- "@tsed/cli-core": "6.1.8",
26
- "@tsed/typescript": "6.1.8",
24
+ "@tsed/cli": "6.1.10",
25
+ "@tsed/cli-core": "6.1.10",
26
+ "@tsed/typescript": "6.1.10",
27
27
  "cross-env": "7.0.3",
28
28
  "typescript": "5.6.2",
29
29
  "vitest": "2.1.1"
@@ -0,0 +1,71 @@
1
+ // For a detailed explanation regarding each configuration property, visit:
2
+ // https://jestjs.io/docs/en/configuration.html
3
+
4
+ /** @type {import('jest').Config} */
5
+ export default {
6
+ // Automatically clear mock calls and instances between every test
7
+ clearMocks: true,
8
+
9
+ // Indicates whether the coverage information should be collected while executing the test
10
+ collectCoverage: true,
11
+
12
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
13
+ // collectCoverageFrom: undefined,
14
+
15
+ // The directory where Jest should output its coverage files
16
+ coverageDirectory: "coverage",
17
+
18
+ // An array of regexp pattern strings used to skip coverage collection
19
+ coveragePathIgnorePatterns: ["index.ts", "/node_modules/"],
20
+
21
+ // An object that configures minimum threshold enforcement for coverage results
22
+ coverageThreshold: {
23
+ global: {
24
+ branches: 70,
25
+ functions: 70,
26
+ lines: 70,
27
+ statements: 70
28
+ }
29
+ },
30
+
31
+ // An array of file extensions your modules use
32
+ moduleFileExtensions: ["js", "json", "jsx", "ts", "tsx", "node"],
33
+ extensionsToTreatAsEsm: [".ts", ".tsx"],
34
+ // The test environment that will be used for testing
35
+ testEnvironment: "node",
36
+
37
+ // The glob patterns Jest uses to detect test files
38
+ testMatch: ["**/src/**/__tests__/**/*.[jt]s?(x)", "**/src/**/?(*.)+(spec|test).[tj]s?(x)"],
39
+ // A map from regular expressions to paths to transformers
40
+ transform: {
41
+ "^.+\\.(j|t)sx?$": [
42
+ "@swc/jest",
43
+ {
44
+ jsc: {
45
+ parser: {
46
+ syntax: "typescript",
47
+ tsx: true,
48
+ decorators: true,
49
+ dynamicImport: true,
50
+ importMeta: true,
51
+ preserveAllComments: true
52
+ },
53
+ target: "esnext",
54
+ transform: {
55
+ useDefineForClassFields: false,
56
+ legacyDecorator: true,
57
+ decoratorMetadata: true
58
+ }
59
+ },
60
+ module: {
61
+ type: "es6"
62
+ }
63
+ }
64
+ ]
65
+ },
66
+ moduleNameMapper: {
67
+ "^(\\.{1,2}/.*)\\.js$": "$1"
68
+ },
69
+ testPathIgnorePatterns: ["/node_modules/", "/dist/"],
70
+ transformIgnorePatterns: ["/node_modules/(?!(module-name|another-module)/)"]
71
+ };
@@ -1,55 +0,0 @@
1
- // For a detailed explanation regarding each configuration property, visit:
2
- // https://jestjs.io/docs/en/configuration.html
3
-
4
- module.exports = {
5
- // Automatically clear mock calls and instances between every test
6
- clearMocks: true,
7
-
8
- // Indicates whether the coverage information should be collected while executing the test
9
- collectCoverage: true,
10
-
11
- // An array of glob patterns indicating a set of files for which coverage information should be collected
12
- // collectCoverageFrom: undefined,
13
-
14
- // The directory where Jest should output its coverage files
15
- coverageDirectory: 'coverage',
16
-
17
- // An array of regexp pattern strings used to skip coverage collection
18
- coveragePathIgnorePatterns: [
19
- 'index.ts',
20
- '/node_modules/'
21
- ],
22
-
23
- // An object that configures minimum threshold enforcement for coverage results
24
- coverageThreshold: {
25
- global: {
26
- 'branches': 70,
27
- 'functions': 70,
28
- 'lines': 70,
29
- 'statements': 70
30
- }
31
- },
32
-
33
- // An array of file extensions your modules use
34
- moduleFileExtensions: [
35
- 'js',
36
- 'json',
37
- 'jsx',
38
- 'ts',
39
- 'tsx',
40
- 'node'
41
- ],
42
-
43
- // The test environment that will be used for testing
44
- testEnvironment: 'node',
45
-
46
- // The glob patterns Jest uses to detect test files
47
- testMatch: [
48
- '**/src/**/__tests__/**/*.[jt]s?(x)',
49
- '**/src/**/?(*.)+(spec|test).[tj]s?(x)'
50
- ],
51
- // A map from regular expressions to paths to transformers
52
- transform: {
53
- '\\.(ts)$': 'ts-jest'
54
- }
55
- }