jest-preset-angular 14.2.2 → 14.2.4
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/CHANGELOG.md +18 -0
- package/build/transformers/jit_transform.js +54 -35
- package/build/transformers/replace-resources.js +2 -2
- package/jest-cjs.config.ts +8 -0
- package/jest-esm.config.ts +8 -0
- package/{jest.config.ts → jest-src.config.ts} +3 -6
- package/jest-transpile-cjs.config.ts +8 -0
- package/jest-transpile-esm.config.ts +8 -0
- package/package.json +34 -25
- package/setup-e2e-test.ts +19 -0
- package/tsconfig-base.spec.json +7 -0
|
@@ -117,7 +117,7 @@ function visitComponentMetadata(nodeFactory, node, resourceImportDeclarations, m
|
|
|
117
117
|
}
|
|
118
118
|
return nodeFactory.updatePropertyAssignment(node, nodeFactory.createIdentifier(constants_1.TEMPLATE), importName);
|
|
119
119
|
case constants_1.STYLES:
|
|
120
|
-
if (!typescript_1.default.isArrayLiteralExpression(node.initializer) && !typescript_1.default.
|
|
120
|
+
if (!typescript_1.default.isArrayLiteralExpression(node.initializer) && !typescript_1.default.isStringLiteralLike(node.initializer)) {
|
|
121
121
|
return node;
|
|
122
122
|
}
|
|
123
123
|
return undefined;
|
|
@@ -127,7 +127,7 @@ function visitComponentMetadata(nodeFactory, node, resourceImportDeclarations, m
|
|
|
127
127
|
}
|
|
128
128
|
return undefined;
|
|
129
129
|
case constants_1.STYLE_URL:
|
|
130
|
-
if (!typescript_1.default.
|
|
130
|
+
if (!typescript_1.default.isStringLiteralLike(node.initializer)) {
|
|
131
131
|
return node;
|
|
132
132
|
}
|
|
133
133
|
return undefined;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import type { JestConfigWithTsJest } from 'ts-jest';
|
|
2
2
|
|
|
3
3
|
const config: JestConfigWithTsJest = {
|
|
4
|
-
moduleNameMapper: {
|
|
5
|
-
'@angular/compiler-cli/ngcc': '<rootDir>/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js',
|
|
6
|
-
},
|
|
7
|
-
testEnvironment: 'jsdom',
|
|
8
4
|
modulePathIgnorePatterns: ['examples/.*', 'website/.*'],
|
|
9
|
-
|
|
5
|
+
testMatch: ['<rootDir>/src/**/*.spec.ts'],
|
|
6
|
+
testEnvironment: 'jsdom',
|
|
10
7
|
transform: {
|
|
11
8
|
'^.+\\.(ts|js|mjs|html)$': [
|
|
12
9
|
'<rootDir>/build/index.js',
|
|
13
10
|
{
|
|
14
|
-
tsconfig: 'tsconfig.spec.json',
|
|
11
|
+
tsconfig: 'tsconfig-base.spec.json',
|
|
15
12
|
isolatedModules: true,
|
|
16
13
|
},
|
|
17
14
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-preset-angular",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.4",
|
|
4
4
|
"description": "Jest preset configuration for Angular projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
"lint-fix": "eslint --fix .",
|
|
34
34
|
"lint-prettier": "prettier \"**/*.{yml,yaml,md}\" --write",
|
|
35
35
|
"lint-prettier-ci": "prettier \"**/*.{yml,yaml,md}\" --check",
|
|
36
|
-
"pretest": "tsc -p tsconfig.spec.json --noEmit",
|
|
37
|
-
"test": "yarn build && jest",
|
|
36
|
+
"pretest": "tsc -p tsconfig-cjs-base.spec.json --noEmit",
|
|
37
|
+
"test": "yarn build && jest -c=jest-cjs.config.ts --no-cache && jest -c=jest-transpile-cjs.config.ts --no-cache",
|
|
38
|
+
"test-esm": "yarn build && node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.ts --no-cache && node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-transpile-esm.config.ts --no-cache",
|
|
38
39
|
"test-examples": "node scripts/test-examples.js",
|
|
39
40
|
"doc": "cd website && yarn start",
|
|
40
41
|
"doc:build": "cd website && yarn build",
|
|
@@ -63,49 +64,57 @@
|
|
|
63
64
|
"typescript": ">=4.8"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@angular-devkit/build-angular": "^18.
|
|
67
|
-
"@angular-eslint/eslint-plugin": "^
|
|
68
|
-
"@angular-eslint/eslint-plugin-template": "^
|
|
69
|
-
"@angular-eslint/template-parser": "^
|
|
70
|
-
"@angular/animations": "^18.
|
|
71
|
-
"@angular/
|
|
72
|
-
"@angular/
|
|
73
|
-
"@angular/compiler
|
|
74
|
-
"@angular/
|
|
75
|
-
"@angular/
|
|
76
|
-
"@angular/
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
67
|
+
"@angular-devkit/build-angular": "^18.2.4",
|
|
68
|
+
"@angular-eslint/eslint-plugin": "^18.3.1",
|
|
69
|
+
"@angular-eslint/eslint-plugin-template": "^18.3.1",
|
|
70
|
+
"@angular-eslint/template-parser": "^18.3.1",
|
|
71
|
+
"@angular/animations": "^18.2.4",
|
|
72
|
+
"@angular/cdk": "^18.2.3",
|
|
73
|
+
"@angular/common": "^18.2.4",
|
|
74
|
+
"@angular/compiler": "^18.2.4",
|
|
75
|
+
"@angular/compiler-cli": "^18.2.4",
|
|
76
|
+
"@angular/core": "^18.2.4",
|
|
77
|
+
"@angular/forms": "^18.2.4",
|
|
78
|
+
"@angular/material": "^18.2.3",
|
|
79
|
+
"@angular/platform-browser": "^18.2.4",
|
|
80
|
+
"@angular/platform-browser-dynamic": "^18.2.4",
|
|
81
|
+
"@babel/core": "^7.25.2",
|
|
82
|
+
"@babel/preset-env": "^7.25.4",
|
|
83
|
+
"@commitlint/cli": "^19.5.0",
|
|
84
|
+
"@commitlint/config-angular": "^19.5.0",
|
|
79
85
|
"@jest/transform": "^29.7.0",
|
|
80
86
|
"@jest/types": "^29.6.3",
|
|
87
|
+
"@types/babel__core": "^7.20.5",
|
|
88
|
+
"@types/babel__preset-env": "^7.9.7",
|
|
81
89
|
"@types/jest": "^29.5.12",
|
|
82
|
-
"@types/node": "^20.
|
|
90
|
+
"@types/node": "^20.16.5",
|
|
83
91
|
"@types/semver": "^7.5.8",
|
|
84
92
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
85
93
|
"@typescript-eslint/parser": "^7.18.0",
|
|
94
|
+
"babel-jest": "^29.7.0",
|
|
86
95
|
"chalk": "^4.1.2",
|
|
87
96
|
"conventional-changelog-cli": "^5.0.0",
|
|
88
97
|
"cross-env": "^7.0.3",
|
|
89
98
|
"eslint": "^8.57.0",
|
|
90
99
|
"eslint-config-prettier": "^9.1.0",
|
|
91
|
-
"eslint-plugin-import": "^2.
|
|
92
|
-
"eslint-plugin-jest": "^28.
|
|
93
|
-
"eslint-plugin-jsdoc": "^
|
|
100
|
+
"eslint-plugin-import": "^2.30.0",
|
|
101
|
+
"eslint-plugin-jest": "^28.8.3",
|
|
102
|
+
"eslint-plugin-jsdoc": "^50.2.2",
|
|
94
103
|
"eslint-plugin-prettier": "^4.2.1",
|
|
95
104
|
"execa": "5.1.1",
|
|
96
105
|
"fs-extra": "^11.2.0",
|
|
97
106
|
"github-files-fetcher": "^1.6.0",
|
|
98
107
|
"glob": "^10.4.5",
|
|
99
|
-
"husky": "^9.1.
|
|
108
|
+
"husky": "^9.1.6",
|
|
100
109
|
"jest": "^29.7.0",
|
|
101
110
|
"pinst": "^3.0.0",
|
|
102
111
|
"prettier": "^2.8.8",
|
|
103
|
-
"rimraf": "^5.0.
|
|
112
|
+
"rimraf": "^5.0.10",
|
|
104
113
|
"rxjs": "^7.8.1",
|
|
105
114
|
"ts-node": "^10.9.2",
|
|
106
|
-
"tslib": "^2.
|
|
115
|
+
"tslib": "^2.7.0",
|
|
107
116
|
"typescript": "~5.5.4",
|
|
108
|
-
"zone.js": "~0.
|
|
117
|
+
"zone.js": "~0.15.0"
|
|
109
118
|
},
|
|
110
|
-
"packageManager": "yarn@4.
|
|
119
|
+
"packageManager": "yarn@4.4.1"
|
|
111
120
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { sync as spawnSync } from 'execa';
|
|
5
|
+
import { sync as globSync } from 'glob';
|
|
6
|
+
|
|
7
|
+
const globalSetup = async () => {
|
|
8
|
+
const e2eFoldersToInstallDeps = globSync('e2e/*')
|
|
9
|
+
.map((folderPath) => path.join(process.cwd(), folderPath))
|
|
10
|
+
.filter((folderPath) => existsSync(path.join(folderPath, 'package.json')));
|
|
11
|
+
|
|
12
|
+
e2eFoldersToInstallDeps.forEach((folderPath) => {
|
|
13
|
+
spawnSync('yarn', ['install'], {
|
|
14
|
+
cwd: folderPath,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default globalSetup;
|