Repository navigation
Expand file tree
/
Copy pathjest.config.js
More file actions
36 lines (35 loc) · 2.09 KB
/
Copy pathjest.config.js
File metadata and controls
36 lines (35 loc) · 2.09 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
/** @type {import('jest').Config} */
const config = {
testEnvironment: "jsdom",
transform: {
"^.+\\.(js|jsx|ts|tsx)$": ["babel-jest", { configFile: "./babel.jest.config.js" }],
},
moduleNameMapper: {
// CSS / static asset stubs
"^.+\\.(css|scss|sass|less)$": "<rootDir>/__mocks__/styleMock.js",
"^.+\\.(png|jpg|jpeg|gif|svg|ico|webp)$": "<rootDir>/__mocks__/fileMock.js",
// Heavy native modules — stub them out in the test environment
"^@stellar/stellar-sdk$": "<rootDir>/__mocks__/stellarSdkMock.js",
"^@stellar/stellar-sdk/(.*)$": "<rootDir>/__mocks__/stellarSdkMock.js",
"^@creit\\.tech/stellar-wallets-kit$": "<rootDir>/__mocks__/walletKitMock.js",
"^@creit\\.tech/stellar-wallets-kit/(.*)$": "<rootDir>/__mocks__/walletKitMock.js",
},
testMatch: [
"**/__tests__/**/*.(ts|tsx|js|jsx)",
"**/*.(test|spec).(ts|tsx|js|jsx)",
],
testPathIgnorePatterns: ["/node_modules/", "/.next/", "/e2e/", "/tests/e2e/", "storybook.visual.spec"],
// react-markdown / rehype-sanitize and the unified ecosystem ship ESM only.
transformIgnorePatterns: [
"/node_modules/(?!(react-markdown|rehype-.*|remark-.*|unified|unist-.*|mdast-.*|hast-.*|hastscript|micromark.*|vfile.*|bail|ccount|comma-separated-tokens|space-separated-tokens|character-entities.*|character-reference-invalid|decode-named-character-reference|devlop|estree-util-.*|html-url-attributes|is-.*|longest-streak|markdown-table|parse-entities|property-information|stringify-entities|trim-lines|trough|web-namespaces|zwitch|html-void-elements|style-to-.*|inline-style-parser|@ungap)/)",
],
moduleDirectories: ["node_modules", "<rootDir>/src"],
coverageThreshold: {
// Issue #123: every resilience policy branch is unit-tested.
"./src/lib/api/resilience/": { branches: 90, functions: 90, lines: 90, statements: 90 },
"./src/lib/validation/": { branches: 85, functions: 90, lines: 90, statements: 90 },
// Clear-signing comparator (#119): every branch is a security check.
"./src/lib/soroban/intent.ts": { branches: 100, functions: 100, lines: 100, statements: 100 },
},
};
module.exports = config;