Skip to content

Commit 1234ad3

Browse files
Update dependencies and migrate jest configuration
1 parent ccf5c17 commit 1234ad3

File tree

11 files changed

+1337
-1029
lines changed

11 files changed

+1337
-1029
lines changed

.github/workflows/actions.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
node-version: [20.x]
1919

2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@v6
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
- run: npm ci
@@ -35,9 +35,9 @@ jobs:
3535
node-version: [20.x]
3636

3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v6
3939
- name: Use Node.js ${{ matrix.node-version }}
40-
uses: actions/setup-node@v4
40+
uses: actions/setup-node@v6
4141
with:
4242
node-version: ${{ matrix.node-version }}
4343
- run: npm ci
@@ -52,9 +52,9 @@ jobs:
5252
node-version: [20.x, 22.x, 24.x]
5353

5454
steps:
55-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v6
5656
- name: Use Node.js ${{ matrix.node-version }}
57-
uses: actions/setup-node@v4
57+
uses: actions/setup-node@v6
5858
with:
5959
node-version: ${{ matrix.node-version }}
6060
- run: npm ci
@@ -69,9 +69,9 @@ jobs:
6969
node-version: [20.x]
7070

7171
steps:
72-
- uses: actions/checkout@v4
72+
- uses: actions/checkout@v6
7373
- name: Use Node.js ${{ matrix.node-version }}
74-
uses: actions/setup-node@v4
74+
uses: actions/setup-node@v6
7575
with:
7676
node-version: ${{ matrix.node-version }}
7777
- run: npm ci

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424

2525
steps:
2626
- name: Checkout target branch
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v6
2828
with:
2929
ref: ${{ github.ref_name }}
3030

3131
- name: Set up Node.js
32-
uses: actions/setup-node@v4
32+
uses: actions/setup-node@v6
3333
with:
3434
node-version: '20'
3535

@@ -103,7 +103,7 @@ jobs:
103103

104104
steps:
105105
- name: Checkout repo
106-
uses: actions/checkout@v4
106+
uses: actions/checkout@v6
107107

108108
- name: Extract release data
109109
id: release_data

eslint.config.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { FlatCompat } from '@eslint/eslintrc';
2+
import js from '@eslint/js';
13
import typescriptEslint from '@typescript-eslint/eslint-plugin';
2-
import prettier from 'eslint-plugin-prettier';
34
import tsParser from '@typescript-eslint/parser';
5+
import prettier from 'eslint-plugin-prettier';
46
import path from 'node:path';
57
import { fileURLToPath } from 'node:url';
6-
import js from '@eslint/js';
7-
import { FlatCompat } from '@eslint/eslintrc';
88

99
const __filename = fileURLToPath(import.meta.url);
1010
const __dirname = path.dirname(__filename);
@@ -40,7 +40,8 @@ export default [
4040
rules: {
4141
'no-empty-function': 'off',
4242
'@typescript-eslint/no-empty-function': 'off',
43-
'@typescript-eslint/no-explicit-any': 'off'
43+
'@typescript-eslint/no-explicit-any': 'off',
44+
'preserve-caught-error': 'off',
4445
}
4546
}
4647
];

jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

jest.config.ts

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
/**
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/configuration
4+
*/
5+
6+
import type { Config } from 'jest';
7+
8+
const config: Config = {
9+
// All imported modules in your tests should be mocked automatically
10+
// automock: false,
11+
12+
// Stop running tests after `n` failures
13+
// bail: 0,
14+
15+
// The directory where Jest should store its cached dependency information
16+
// cacheDirectory: "/private/var/folders/dl/46t7lsds66g09wjgn0fms2zh0000gn/T/jest_dx",
17+
18+
// Automatically clear mock calls, instances, contexts and results before every test
19+
clearMocks: true,
20+
21+
// Indicates whether the coverage information should be collected while executing the test
22+
// collectCoverage: true,
23+
24+
// An array of glob patterns indicating a set of files for which coverage information should be collected
25+
collectCoverageFrom: [
26+
"src/**/*.ts",
27+
],
28+
29+
// The directory where Jest should output its coverage files
30+
coverageDirectory: "coverage",
31+
32+
// An array of regexp pattern strings used to skip coverage collection
33+
coveragePathIgnorePatterns: [
34+
"/node_modules/"
35+
],
36+
37+
// Indicates which provider should be used to instrument code for coverage
38+
coverageProvider: "v8",
39+
40+
// A list of reporter names that Jest uses when writing coverage reports
41+
coverageReporters: [
42+
// "json",
43+
"text",
44+
"lcov",
45+
// "clover"
46+
],
47+
48+
// An object that configures minimum threshold enforcement for coverage results
49+
coverageThreshold: {
50+
global: {
51+
branches: 90,
52+
functions: 90,
53+
lines: 90,
54+
statements: 90
55+
}
56+
},
57+
58+
// A path to a custom dependency extractor
59+
// dependencyExtractor: undefined,
60+
61+
// Make calling deprecated APIs throw helpful error messages
62+
// errorOnDeprecated: false,
63+
64+
// The default configuration for fake timers
65+
// fakeTimers: {
66+
// "enableGlobally": false
67+
// },
68+
69+
// Force coverage collection from ignored files using an array of glob patterns
70+
// forceCoverageMatch: [],
71+
72+
// A path to a module which exports an async function that is triggered once before all test suites
73+
// globalSetup: undefined,
74+
75+
// A path to a module which exports an async function that is triggered once after all test suites
76+
// globalTeardown: undefined,
77+
78+
// A set of global variables that need to be available in all test environments
79+
// globals: {},
80+
81+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
82+
// maxWorkers: "50%",
83+
84+
// An array of directory names to be searched recursively up from the requiring module's location
85+
// moduleDirectories: [
86+
// "node_modules"
87+
// ],
88+
89+
// An array of file extensions your modules use
90+
moduleFileExtensions: [
91+
"js",
92+
// "mjs",
93+
// "cjs",
94+
// "jsx",
95+
"ts",
96+
// "mts",
97+
// "cts",
98+
// "tsx",
99+
"json",
100+
// "node"
101+
],
102+
103+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
104+
moduleNameMapper: {
105+
'^(\\.{1,2}/.*)\\.js$': '$1',
106+
},
107+
108+
// moduleNameMapper: {
109+
// Activates notifications for test results
110+
// notify: false,
111+
112+
// An enum that specifies notification mode. Requires { notify: true }
113+
// notifyMode: "failure-change",
114+
115+
// A preset that is used as a base for Jest's configuration
116+
preset: 'ts-jest',
117+
118+
// Run tests from one or more projects
119+
// projects: undefined,
120+
121+
// Use this configuration option to add custom reporters to Jest
122+
// reporters: undefined,
123+
124+
// Automatically reset mock state before every test
125+
// resetMocks: false,
126+
127+
// Reset the module registry before running each individual test
128+
// resetModules: false,
129+
130+
// A path to a custom resolver
131+
// resolver: undefined,
132+
133+
// Automatically restore mock state and implementation before every test
134+
// restoreMocks: false,
135+
136+
// The root directory that Jest should scan for tests and modules within
137+
// rootDir: undefined,
138+
139+
// A list of paths to directories that Jest should use to search for files in
140+
// roots: [
141+
// "<rootDir>"
142+
// ],
143+
144+
// Allows you to use a custom runner instead of Jest's default test runner
145+
// runner: "jest-runner",
146+
147+
// The paths to modules that run some code to configure or set up the testing environment before each test
148+
// setupFiles: [],
149+
150+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
151+
// setupFilesAfterEnv: [],
152+
153+
// The number of seconds after which a test is considered as slow and reported as such in the results.
154+
// slowTestThreshold: 5,
155+
156+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
157+
// snapshotSerializers: [],
158+
159+
// The test environment that will be used for testing
160+
testEnvironment: "jest-environment-node",
161+
162+
// Options that will be passed to the testEnvironment
163+
// testEnvironmentOptions: {},
164+
165+
// Adds a location field to test results
166+
// testLocationInResults: false,
167+
168+
// The glob patterns Jest uses to detect test files
169+
// testMatch: [
170+
// "**/__tests__/**/*.?([mc])[jt]s?(x)",
171+
// "**/?(*.)+(spec|test).?([mc])[jt]s?(x)"
172+
// ],
173+
174+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
175+
// testPathIgnorePatterns: [
176+
// "/node_modules/"
177+
// ],
178+
179+
// The regexp pattern or array of patterns that Jest uses to detect test files
180+
testRegex: ["(/__test__/.*|(\\.|/)(test|spec))\\.(tsx?)$"],
181+
182+
// This option allows the use of a custom results processor
183+
// testResultsProcessor: undefined,
184+
185+
// This option allows use of a custom test runner
186+
// testRunner: "jest-circus/runner",
187+
188+
// A map from regular expressions to paths to transformers
189+
transform: {
190+
'^.+\\.tsx?$': 'ts-jest',
191+
'^.+\\.m?jsx?$': 'ts-jest',
192+
},
193+
194+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
195+
transformIgnorePatterns: [
196+
'node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async|strict-event-emitter|@open-draft)/)'
197+
],
198+
199+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
200+
// unmockedModulePathPatterns: undefined,
201+
202+
// Indicates whether each individual test should be reported during the run
203+
verbose: true,
204+
205+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
206+
// watchPathIgnorePatterns: [],
207+
208+
// Whether to use watchman for file crawling
209+
// watchman: true,
210+
};
211+
212+
export default config;

jest.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)