forked from privacy-scaling-explorations/zk-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
33 lines (30 loc) · 1.06 KB
/
jest.config.ts
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
import fs from "fs"
import type { Config } from "@jest/types"
const exclude = ["circuits", "imt.sol", "rollup-plugin-rust", "lazytower.sol", "lazytower.circom"]
const projects: any = fs
.readdirSync("./packages", { withFileTypes: true })
.filter((directory) => directory.isDirectory())
.filter((directory) => !exclude.includes(directory.name))
.map(({ name }) => ({
preset: "ts-jest",
rootDir: `packages/${name}`,
displayName: name,
moduleNameMapper: {
"@zk-kit/artifacts": ["<rootDir>/../../node_modules/@zk-kit/artifacts/dist/index.node.cjs"],
"@zk-kit/(.*)/(.*)": ["<rootDir>/../$1/src/$2.ts", "<rootDir>/../$1/src/$2/$2.node.ts"],
"@zk-kit/(.*)": "<rootDir>/../$1/src/index.ts"
}
}))
export default async (): Promise<Config.InitialOptions> => ({
projects,
verbose: true,
coverageDirectory: "./coverage",
coverageThreshold: {
global: {
branches: 90,
functions: 95,
lines: 95,
statements: 95
}
}
})