@forsakringskassan/jest-config 27.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.
Files changed (3) hide show
  1. package/jest-preset.js +68 -0
  2. package/jest.js +13 -0
  3. package/package.json +43 -0
package/jest-preset.js ADDED
@@ -0,0 +1,68 @@
1
+ module.exports = {
2
+ /* put cache in working directory in case multiple simultaneous processes
3
+ * runs the same tests (i.e. multiple jenkins jobs on the same node). */
4
+ cacheDirectory: "<rootDir>/.jest-cache",
5
+
6
+ /* collect coverage by default */
7
+ collectCoverage: true,
8
+
9
+ /* collect coverage from source folders only, ignoring test-cases and other
10
+ * misc files */
11
+ collectCoverageFrom: [
12
+ "src/**/*.[jt]s",
13
+ "packages/*/src/**/*.[jt]s",
14
+
15
+ /* patterns to ignore */
16
+ "!**/*.spec.[jt]s",
17
+ "!**/*.d.ts",
18
+ "!**/index.[jt]s",
19
+ "!**/__fixtures__/**",
20
+ "!**/generated/**",
21
+ ],
22
+
23
+ coverageReporters: [
24
+ "text",
25
+ "text-summary",
26
+ "cobertura",
27
+ "html",
28
+ "json",
29
+ "lcov",
30
+ ],
31
+
32
+ /* ignore files in the temp folder, sometimes used to put typescript
33
+ * declarations before dts rollup */
34
+ modulePathIgnorePatterns: ["<rootDir>/temp"],
35
+
36
+ /* transform typescript with ts-jest */
37
+ transform: {
38
+ "^.+\\.tsx?$": require.resolve("ts-jest"),
39
+ },
40
+
41
+ /* while test-cases should not be compiled explicitly ignore them anyway in
42
+ * case they are accidentally compiled to the "dist" folder */
43
+ testPathIgnorePatterns: [
44
+ "/node_modules/",
45
+ "<rootDir>/build/",
46
+ "<rootDir>/dist/",
47
+ "<rootDir>/cypress/",
48
+ "<rootDir>/packages/.*/build/",
49
+ "<rootDir>/packages/.*/dist/",
50
+ ],
51
+
52
+ watchPlugins: [
53
+ require.resolve("jest-watch-typeahead/filename"),
54
+ require.resolve("jest-watch-typeahead/testname"),
55
+ ],
56
+
57
+ /* add junit report in addition to default output */
58
+ reporters: [
59
+ "default",
60
+ [
61
+ require.resolve("jest-junit"),
62
+ {
63
+ suiteName: "jest tests",
64
+ outputName: "test-results/jest-junit.xml",
65
+ },
66
+ ],
67
+ ],
68
+ };
package/jest.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require("path");
4
+ const { spawn } = require("child_process");
5
+
6
+ const pkgPath = path.dirname(require.resolve("jest/package.json"));
7
+ const binary = path.join(pkgPath, "bin/jest.js");
8
+
9
+ spawn("node", [binary, ...process.argv.slice(2)], {
10
+ stdio: "inherit",
11
+ }).on("exit", (code) => {
12
+ process.exit(code);
13
+ });
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@forsakringskassan/jest-config",
3
+ "version": "27.1.0",
4
+ "description": "Shareable jest configuration for npm packages",
5
+ "keywords": [
6
+ "jest"
7
+ ],
8
+ "homepage": "https://github.com/Forsakringskassan/jest-config",
9
+ "bugs": "https://github.com/Forsakringskassan/jest-config/issues",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/Forsakringskassan/jest-config.git",
13
+ "directory": "packages/jest-config"
14
+ },
15
+ "license": "MIT",
16
+ "author": "Försäkringskassan",
17
+ "main": "jest-preset.js",
18
+ "bin": {
19
+ "jest": "jest.js"
20
+ },
21
+ "files": [
22
+ "jest.js",
23
+ "jest-preset.js"
24
+ ],
25
+ "scripts": {
26
+ "pretest": "node jest --version",
27
+ "test": "node jest --passWithNoTests"
28
+ },
29
+ "jest": {
30
+ "preset": "."
31
+ },
32
+ "dependencies": {
33
+ "jest": "27.5.1",
34
+ "jest-junit": "16.0.0",
35
+ "jest-watch-typeahead": "2.2.2",
36
+ "ts-jest": "27.1.5"
37
+ },
38
+ "engines": {
39
+ "node": ">= 16.10",
40
+ "npm": ">= 7"
41
+ },
42
+ "gitHead": "0596322312b1f0627683553d5dc5abf1b0e1b6b1"
43
+ }