forked from connectrpc/connect-query-es
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest-preset.js
49 lines (48 loc) · 2.1 KB
/
jest-preset.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2021-2023 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/** @type {import('jest').Config} */
module.exports = {
collectCoverage: true,
coverageReporters: ["json", "lcov", "text", "clover", "text-summary"],
coveragePathIgnorePatterns: ["src/jest", "src/gen"],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
injectGlobals: false,
clearMocks: true,
snapshotFormat: {
printBasicPrototype: false,
},
workerThreads: true, // Enabled so jest would stop complaining about serializing BigInt. See https://github.com/jestjs/jest/issues/11617#issuecomment-1458155552 for details
transform: {
"^.+\\.(ts|tsx|js)$": [
"ts-jest",
{
isolatedModules: false,
diagnostics: {
ignoreCodes: [
7031, // TODO: this is, for some reason, needed because of a problem with local linking and TypeScript that we haven't debugged because it won't matter by the time this PR merges because connect will have already released
6196, // unused variables are necessary because all TypeScript type tests are technically unused (type) variables
151001, // ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
],
},
},
],
},
};