@ttoss/config 1.14.1 → 1.14.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/dist/esm/index.js CHANGED
@@ -42,7 +42,9 @@ var defaultConfig3 = {
42
42
  moduleNameMapper: {
43
43
  "\\.(css)$": "identity-obj-proxy"
44
44
  },
45
- timers: "fake"
45
+ fakeTimers: {
46
+ enableGlobally: true
47
+ }
46
48
  };
47
49
  var jestConfig = configCreator(defaultConfig3);
48
50
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { Config } from '@jest/types';
2
1
  import { Options } from 'tsup';
3
2
 
4
3
  declare const babelConfig: (config?: any, deepmergeConfig?: {
@@ -9,237 +8,9 @@ declare const commitlintConfig: (config?: any, deepmergeConfig?: {
9
8
  arrayMerge: "append" | "overwrite";
10
9
  } | undefined) => any;
11
10
 
12
- declare const jestConfig: (config?: Partial<{
13
- automock: boolean;
14
- bail: number | boolean;
15
- cache: boolean;
16
- cacheDirectory: string;
17
- ci: boolean;
18
- clearMocks: boolean;
19
- changedFilesWithAncestor: boolean;
20
- changedSince: string;
21
- collectCoverage: boolean;
22
- collectCoverageFrom: string[];
23
- collectCoverageOnlyFrom: {
24
- [key: string]: boolean;
25
- };
26
- coverageDirectory: string;
27
- coveragePathIgnorePatterns: string[];
28
- coverageProvider: "v8" | "babel";
29
- coverageReporters: Config.CoverageReporters;
30
- coverageThreshold: {
31
- [path: string]: Config.CoverageThresholdValue;
32
- global: Config.CoverageThresholdValue;
33
- };
34
- dependencyExtractor: string;
35
- detectLeaks: boolean;
36
- detectOpenHandles: boolean;
37
- displayName: string | Config.DisplayName;
38
- expand: boolean;
39
- extensionsToTreatAsEsm: string[];
40
- extraGlobals: string[];
41
- filter: string;
42
- findRelatedTests: boolean;
43
- forceCoverageMatch: string[];
44
- forceExit: boolean;
45
- json: boolean;
46
- globals: Config.ConfigGlobals;
47
- globalSetup: string | null | undefined;
48
- globalTeardown: string | null | undefined;
49
- haste: Config.HasteConfig;
50
- injectGlobals: boolean;
51
- reporters: (string | Config.ReporterConfig)[];
52
- logHeapUsage: boolean;
53
- lastCommit: boolean;
54
- listTests: boolean;
55
- maxConcurrency: number;
56
- maxWorkers: string | number;
57
- moduleDirectories: string[];
58
- moduleFileExtensions: string[];
59
- moduleLoader: string;
60
- moduleNameMapper: {
61
- [key: string]: string | string[];
62
- };
63
- modulePathIgnorePatterns: string[];
64
- modulePaths: string[];
65
- name: string;
66
- noStackTrace: boolean;
67
- notify: boolean;
68
- notifyMode: string;
69
- onlyChanged: boolean;
70
- onlyFailures: boolean;
71
- outputFile: string;
72
- passWithNoTests: boolean;
73
- preprocessorIgnorePatterns: string[];
74
- preset: string | null | undefined;
75
- prettierPath: string | null | undefined;
76
- projects: (string | Config.InitialProjectOptions)[];
77
- replname: string | null | undefined;
78
- resetMocks: boolean;
79
- resetModules: boolean;
80
- resolver: string | null | undefined;
81
- restoreMocks: boolean;
82
- rootDir: string;
83
- roots: string[];
84
- runner: string;
85
- runTestsByPath: boolean;
86
- scriptPreprocessor: string;
87
- setupFiles: string[];
88
- setupTestFrameworkScriptFile: string;
89
- setupFilesAfterEnv: string[];
90
- silent: boolean;
91
- skipFilter: boolean;
92
- skipNodeResolution: boolean;
93
- slowTestThreshold: number;
94
- snapshotResolver: string;
95
- snapshotSerializers: string[];
96
- snapshotFormat: Config.PrettyFormatOptions;
97
- errorOnDeprecated: boolean;
98
- testEnvironment: string;
99
- testEnvironmentOptions: Record<string, unknown>;
100
- testFailureExitCode: string | number;
101
- testLocationInResults: boolean;
102
- testMatch: string[];
103
- testNamePattern: string;
104
- testPathDirs: string[];
105
- testPathIgnorePatterns: string[];
106
- testRegex: string | string[];
107
- testResultsProcessor: string;
108
- testRunner: string;
109
- testSequencer: string;
110
- testURL: string;
111
- testTimeout: number;
112
- timers: "fake" | "real" | "modern" | "legacy";
113
- transform: {
114
- [regex: string]: string | Config.TransformerConfig;
115
- };
116
- transformIgnorePatterns: string[];
117
- watchPathIgnorePatterns: string[];
118
- unmockedModulePathPatterns: string[];
119
- updateSnapshot: boolean;
120
- useStderr: boolean;
121
- verbose?: boolean | undefined;
122
- watch: boolean;
123
- watchAll: boolean;
124
- watchman: boolean;
125
- watchPlugins: (string | [string, Record<string, unknown>])[];
126
- }>, deepmergeConfig?: {
11
+ declare const jestConfig: (config?: any, deepmergeConfig?: {
127
12
  arrayMerge: "append" | "overwrite";
128
- } | undefined) => Partial<{
129
- automock: boolean;
130
- bail: number | boolean;
131
- cache: boolean;
132
- cacheDirectory: string;
133
- ci: boolean;
134
- clearMocks: boolean;
135
- changedFilesWithAncestor: boolean;
136
- changedSince: string;
137
- collectCoverage: boolean;
138
- collectCoverageFrom: string[];
139
- collectCoverageOnlyFrom: {
140
- [key: string]: boolean;
141
- };
142
- coverageDirectory: string;
143
- coveragePathIgnorePatterns: string[];
144
- coverageProvider: "v8" | "babel";
145
- coverageReporters: Config.CoverageReporters;
146
- coverageThreshold: {
147
- [path: string]: Config.CoverageThresholdValue;
148
- global: Config.CoverageThresholdValue;
149
- };
150
- dependencyExtractor: string;
151
- detectLeaks: boolean;
152
- detectOpenHandles: boolean;
153
- displayName: string | Config.DisplayName;
154
- expand: boolean;
155
- extensionsToTreatAsEsm: string[];
156
- extraGlobals: string[];
157
- filter: string;
158
- findRelatedTests: boolean;
159
- forceCoverageMatch: string[];
160
- forceExit: boolean;
161
- json: boolean;
162
- globals: Config.ConfigGlobals;
163
- globalSetup: string | null | undefined;
164
- globalTeardown: string | null | undefined;
165
- haste: Config.HasteConfig;
166
- injectGlobals: boolean;
167
- reporters: (string | Config.ReporterConfig)[];
168
- logHeapUsage: boolean;
169
- lastCommit: boolean;
170
- listTests: boolean;
171
- maxConcurrency: number;
172
- maxWorkers: string | number;
173
- moduleDirectories: string[];
174
- moduleFileExtensions: string[];
175
- moduleLoader: string;
176
- moduleNameMapper: {
177
- [key: string]: string | string[];
178
- };
179
- modulePathIgnorePatterns: string[];
180
- modulePaths: string[];
181
- name: string;
182
- noStackTrace: boolean;
183
- notify: boolean;
184
- notifyMode: string;
185
- onlyChanged: boolean;
186
- onlyFailures: boolean;
187
- outputFile: string;
188
- passWithNoTests: boolean;
189
- preprocessorIgnorePatterns: string[];
190
- preset: string | null | undefined;
191
- prettierPath: string | null | undefined;
192
- projects: (string | Config.InitialProjectOptions)[];
193
- replname: string | null | undefined;
194
- resetMocks: boolean;
195
- resetModules: boolean;
196
- resolver: string | null | undefined;
197
- restoreMocks: boolean;
198
- rootDir: string;
199
- roots: string[];
200
- runner: string;
201
- runTestsByPath: boolean;
202
- scriptPreprocessor: string;
203
- setupFiles: string[];
204
- setupTestFrameworkScriptFile: string;
205
- setupFilesAfterEnv: string[];
206
- silent: boolean;
207
- skipFilter: boolean;
208
- skipNodeResolution: boolean;
209
- slowTestThreshold: number;
210
- snapshotResolver: string;
211
- snapshotSerializers: string[];
212
- snapshotFormat: Config.PrettyFormatOptions;
213
- errorOnDeprecated: boolean;
214
- testEnvironment: string;
215
- testEnvironmentOptions: Record<string, unknown>;
216
- testFailureExitCode: string | number;
217
- testLocationInResults: boolean;
218
- testMatch: string[];
219
- testNamePattern: string;
220
- testPathDirs: string[];
221
- testPathIgnorePatterns: string[];
222
- testRegex: string | string[];
223
- testResultsProcessor: string;
224
- testRunner: string;
225
- testSequencer: string;
226
- testURL: string;
227
- testTimeout: number;
228
- timers: "fake" | "real" | "modern" | "legacy";
229
- transform: {
230
- [regex: string]: string | Config.TransformerConfig;
231
- };
232
- transformIgnorePatterns: string[];
233
- watchPathIgnorePatterns: string[];
234
- unmockedModulePathPatterns: string[];
235
- updateSnapshot: boolean;
236
- useStderr: boolean;
237
- verbose?: boolean | undefined;
238
- watch: boolean;
239
- watchAll: boolean;
240
- watchman: boolean;
241
- watchPlugins: (string | [string, Record<string, unknown>])[];
242
- }>;
13
+ } | undefined) => any;
243
14
 
244
15
  declare const lintstagedConfig: (config?: any, deepmergeConfig?: {
245
16
  arrayMerge: "append" | "overwrite";
package/dist/index.js CHANGED
@@ -75,7 +75,9 @@ var defaultConfig3 = {
75
75
  moduleNameMapper: {
76
76
  "\\.(css)$": "identity-obj-proxy"
77
77
  },
78
- timers: "fake"
78
+ fakeTimers: {
79
+ enableGlobally: true
80
+ }
79
81
  };
80
82
  var jestConfig = configCreator(defaultConfig3);
81
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/config",
3
- "version": "1.14.1",
3
+ "version": "1.14.4",
4
4
  "description": "Default configuration for packages.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -40,7 +40,7 @@
40
40
  "identity-obj-proxy": "^3.0.0",
41
41
  "tsup": "^5.11.11"
42
42
  },
43
- "gitHead": "c47a7a0773b8ccdf631942994abc660e68f0597e",
43
+ "gitHead": "ea90cc502669e1a4fd43c780454fd9fa48602304",
44
44
  "devDependencies": {
45
45
  "@jest/types": "^27.4.2"
46
46
  }
package/src/jest.ts CHANGED
@@ -1,201 +1,20 @@
1
- import type { Config } from '@jest/types';
2
-
3
1
  import { configCreator } from './configCreator';
4
2
 
5
3
  /*
6
4
  * For a detailed explanation regarding each configuration property and type check, visit:
7
5
  * https://jestjs.io/docs/configuration
8
6
  */
9
- export const defaultConfig: Config.InitialOptions = {
10
- // All imported modules in your tests should be mocked automatically
11
- // automock: false,
12
-
13
- // Stop running tests after `n` failures
14
- // bail: 0,
15
-
16
- // The directory where Jest should store its cached dependency information
17
- // cacheDirectory: "/tmp/jest_rt",
18
-
19
- // Automatically clear mock calls and instances between every test
7
+ export const defaultConfig = {
20
8
  clearMocks: true,
21
-
22
- // Indicates whether the coverage information should be collected while executing the test
23
9
  collectCoverage: true,
24
-
25
- // An array of glob patterns indicating a set of files for which coverage information should be collected
26
- // collectCoverageFrom: undefined,
27
-
28
- // The directory where Jest should output its coverage files
29
10
  coverageDirectory: 'coverage',
30
-
31
- // An array of regexp pattern strings used to skip coverage collection
32
- // coveragePathIgnorePatterns: [
33
- // "/node_modules/"
34
- // ],
35
-
36
- // Indicates which provider should be used to instrument code for coverage
37
11
  coverageProvider: 'v8',
38
-
39
- // A list of reporter names that Jest uses when writing coverage reports
40
- // coverageReporters: [
41
- // "json",
42
- // "text",
43
- // "lcov",
44
- // "clover"
45
- // ],
46
-
47
- // An object that configures minimum threshold enforcement for coverage results
48
- // coverageThreshold: undefined,
49
-
50
- // A path to a custom dependency extractor
51
- // dependencyExtractor: undefined,
52
-
53
- // Make calling deprecated APIs throw helpful error messages
54
- // errorOnDeprecated: false,
55
-
56
- // Force coverage collection from ignored files using an array of glob patterns
57
- // forceCoverageMatch: [],
58
-
59
- // A path to a module which exports an async function that is triggered once before all test suites
60
- // globalSetup: undefined,
61
-
62
- // A path to a module which exports an async function that is triggered once after all test suites
63
- // globalTeardown: undefined,
64
-
65
- // A set of global variables that need to be available in all test environments
66
- // globals: {},
67
-
68
- // 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.
69
- // maxWorkers: "50%",
70
-
71
- // An array of directory names to be searched recursively up from the requiring module's location
72
- // moduleDirectories: [
73
- // "node_modules"
74
- // ],
75
-
76
- // An array of file extensions your modules use
77
- // moduleFileExtensions: [
78
- // "js",
79
- // "jsx",
80
- // "ts",
81
- // "tsx",
82
- // "json",
83
- // "node"
84
- // ],
85
-
86
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
87
12
  moduleNameMapper: {
88
13
  '\\.(css)$': 'identity-obj-proxy',
89
14
  },
90
-
91
- // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
92
- // modulePathIgnorePatterns: [],
93
-
94
- // Activates notifications for test results
95
- // notify: false,
96
-
97
- // An enum that specifies notification mode. Requires { notify: true }
98
- // notifyMode: "failure-change",
99
-
100
- // A preset that is used as a base for Jest's configuration
101
- // preset: undefined,
102
-
103
- // Run tests from one or more projects
104
- // projects: undefined,
105
-
106
- // Use this configuration option to add custom reporters to Jest
107
- // reporters: undefined,
108
-
109
- // Automatically reset mock state between every test
110
- // resetMocks: false,
111
-
112
- // Reset the module registry before running each individual test
113
- // resetModules: false,
114
-
115
- // A path to a custom resolver
116
- // resolver: undefined,
117
-
118
- // Automatically restore mock state between every test
119
- // restoreMocks: false,
120
-
121
- // The root directory that Jest should scan for tests and modules within
122
- // rootDir: undefined,
123
-
124
- // A list of paths to directories that Jest should use to search for files in
125
- // roots: [
126
- // "<rootDir>"
127
- // ],
128
-
129
- // Allows you to use a custom runner instead of Jest's default test runner
130
- // runner: "jest-runner",
131
-
132
- // The paths to modules that run some code to configure or set up the testing environment before each test
133
- // setupFiles: [],
134
-
135
- // A list of paths to modules that run some code to configure or set up the testing framework before each test
136
- // setupFilesAfterEnv: ['./jest.setup.tsx'],
137
-
138
- // The number of seconds after which a test is considered as slow and reported as such in the results.
139
- // slowTestThreshold: 5,
140
-
141
- // A list of paths to snapshot serializer modules Jest should use for snapshot testing
142
- // snapshotSerializers: [],
143
-
144
- // The test environment that will be used for testing
145
- // testEnvironment: 'jsdom',
146
-
147
- // Options that will be passed to the testEnvironment
148
- // testEnvironmentOptions: {},
149
-
150
- // Adds a location field to test results
151
- // testLocationInResults: false,
152
-
153
- // The glob patterns Jest uses to detect test files
154
- // testMatch: [
155
- // "**/__tests__/**/*.[jt]s?(x)",
156
- // "**/?(*.)+(spec|test).[tj]s?(x)"
157
- // ],
158
-
159
- // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
160
- // testPathIgnorePatterns: [
161
- // "/node_modules/"
162
- // ],
163
-
164
- // The regexp pattern or array of patterns that Jest uses to detect test files
165
- // testRegex: [],
166
-
167
- // This option allows the use of a custom results processor
168
- // testResultsProcessor: undefined,
169
-
170
- // This option allows use of a custom test runner
171
- // testRunner: "jest-circus/runner",
172
-
173
- // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
174
- // testURL: "http://localhost",
175
-
176
- // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
177
- timers: 'fake',
178
-
179
- // A map from regular expressions to paths to transformers
180
- // transform: undefined,
181
-
182
- // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
183
- // transformIgnorePatterns: [
184
- // "/node_modules/",
185
- // "\\.pnp\\.[^\\/]+$"
186
- // ],
187
-
188
- // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
189
- // unmockedModulePathPatterns: undefined,
190
-
191
- // Indicates whether each individual test should be reported during the run
192
- // verbose: undefined,
193
-
194
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
195
- // watchPathIgnorePatterns: [],
196
-
197
- // Whether to use watchman for file crawling
198
- // watchman: true,
15
+ fakeTimers: {
16
+ enableGlobally: true,
17
+ },
199
18
  };
200
19
 
201
- export const jestConfig = configCreator<Config.InitialOptions>(defaultConfig);
20
+ export const jestConfig = configCreator<any>(defaultConfig);