Skip to content

Commit 9a7b0b4

Browse files
committed
add test
1 parent b682932 commit 9a7b0b4

File tree

8 files changed

+28203
-2381
lines changed

8 files changed

+28203
-2381
lines changed

jest.config.js

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

0 commit comments

Comments
 (0)