-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.cjs
More file actions
59 lines (59 loc) · 1.89 KB
/
Copy pathjest.config.cjs
File metadata and controls
59 lines (59 loc) · 1.89 KB
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
50
51
52
53
54
55
56
57
58
59
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
"src/sine-wave-generator.js",
"src/audio-sync.js",
"src/use-sine-wave-generator.js",
"examples/example.js",
"examples/react-quickstart.js",
],
coverageThreshold: {
// Per-file thresholds (not "global", which would average example.js's
// gap into the core library's otherwise-100% coverage and mask it).
"./src/sine-wave-generator.js": {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
"./src/audio-sync.js": {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
"./src/use-sine-wave-generator.js": {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
// branches is 75 rather than 100: stopListening()'s three null-guards
// are fully covered on the "stop after successfully starting" path;
// the "unmount before ever starting" path (audioSyncRef/streamRef
// still null) would need the private AudioReactiveDemo component
// exported just to unmount-test it directly — not worth doing for
// two defensive guards with no user-visible behavior difference.
"./examples/react-quickstart.js": {
branches: 75,
functions: 100,
lines: 100,
statements: 100,
},
// example.js drives ~50 decorative demos across every page template.
// The remaining gap is genuinely unreachable defensive code (guards
// whose "missing element" branch can't occur with the real markup,
// e.g. URL.pathname is never an empty string) or deep per-frame
// internals of one hand-tuned decorative demo (rainbowFundamentals)
// where contriving a test would cost far more than it verifies.
// See __tests__/example.*.test.js for what IS covered.
"./examples/example.js": {
branches: 78,
functions: 94,
lines: 96,
statements: 96,
},
},
testEnvironment: "jsdom",
testPathIgnorePatterns: ["/node_modules/", "/__tests__/helpers/"],
};