@html-validate/jest-config 3.10.0 → 3.11.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/jest-preset.js CHANGED
@@ -1 +1,3 @@
1
+ #!/usr/bin/env node
2
+
1
3
  module.exports = require("./presets/default/jest-preset");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/jest-config",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "Jest sharable preset used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "jest"
@@ -11,20 +11,23 @@
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "https://gitlab.com/html-validate/jest-config.git"
14
+ "url": "git+https://gitlab.com/html-validate/jest-config.git"
15
15
  },
16
16
  "license": "MIT",
17
17
  "author": "David Sveningsson <ext@sidvind.com>",
18
18
  "main": "jest-preset.js",
19
- "bin": "jest-preset.js",
19
+ "bin": {
20
+ "jest-config": "jest-preset.js"
21
+ },
20
22
  "files": [
21
23
  "dist",
22
24
  "lib",
23
25
  "presets",
24
- "jest-preset.js"
26
+ "jest-preset.js",
27
+ "!**/*.spec.js"
25
28
  ],
26
29
  "dependencies": {
27
- "@babel/plugin-transform-modules-commonjs": "7.24.1",
30
+ "@babel/plugin-transform-modules-commonjs": "7.25.9",
28
31
  "babel-plugin-transform-import-meta": "2.2.1",
29
32
  "jest-junit": "16.0.0",
30
33
  "jest-serializer-ansi-escapes": "3.0.0",
@@ -35,7 +38,7 @@
35
38
  "babel-jest": "^25 || ^26 || ^27 || ^28 || ^29",
36
39
  "jest": "^25 || ^26 || ^27 || ^28 || ^29",
37
40
  "ts-jest": "^25 || ^26 || ^27.1 || ^28 || ^29",
38
- "typescript": "^3 || ^4 || ^5"
41
+ "typescript": "^3.9.2 || ^4.6.2 || ^5.0.2"
39
42
  },
40
43
  "peerDependenciesMeta": {
41
44
  "@babel/core": {
@@ -43,7 +46,7 @@
43
46
  }
44
47
  },
45
48
  "engines": {
46
- "node": ">= 14.0",
49
+ "node": ">= 16.0",
47
50
  "npm": ">= 7"
48
51
  },
49
52
  "publishConfig": {
@@ -1,48 +0,0 @@
1
- const { findTsConfig } = require("./find-ts-config");
2
- const fs = require("fs");
3
- const path = require("path");
4
-
5
- jest.mock("fs");
6
-
7
- function mockFilesystem(files) {
8
- jest.spyOn(fs, "existsSync").mockImplementation((filePath) => {
9
- if (filePath.includes("node_modules") || path.dirname(filePath) === __dirname) {
10
- return true;
11
- }
12
- return files.includes(filePath);
13
- });
14
- }
15
-
16
- afterEach(() => {
17
- jest.restoreAllMocks();
18
- });
19
-
20
- it("should find tsconfig.jest.json", () => {
21
- expect.assertions(1);
22
- mockFilesystem(["/path/to/project/tsconfig.jest.json"]);
23
- expect(findTsConfig("/path/to/project")).toBe("/path/to/project/tsconfig.jest.json");
24
- });
25
-
26
- it("should find tsconfig.json", () => {
27
- expect.assertions(1);
28
- mockFilesystem(["/path/to/project/tsconfig.json"]);
29
- expect(findTsConfig("/path/to/project")).toBe("/path/to/project/tsconfig.json");
30
- });
31
-
32
- it("should prefer tsconfig.jest.json over tsconfig.json", () => {
33
- expect.assertions(1);
34
- mockFilesystem(["/path/to/project/tsconfig.jest.json", "/path/to/project/tsconfig.json"]);
35
- expect(findTsConfig("/path/to/project")).toBe("/path/to/project/tsconfig.jest.json");
36
- });
37
-
38
- it("should find from parent directory", () => {
39
- expect.assertions(1);
40
- mockFilesystem(["/path/to/project/tsconfig.jest.json"]);
41
- expect(findTsConfig("/path/to/project/deep/path")).toBe("/path/to/project/tsconfig.jest.json");
42
- });
43
-
44
- it("should return undefined if no config file was found", () => {
45
- expect.assertions(1);
46
- mockFilesystem([]);
47
- expect(findTsConfig("/path/to/project")).toBeUndefined();
48
- });