chore: update jest transformer

Former-commit-id: 8945d9a4849c10385ec8392d713ed5e70ab306bf [formerly 5ee89312c7b05e6de9ca68e6f39a661a10b2162e] [formerly 5531848b2f1b054e048287bda2a4e0f2c28dbacb [formerly 2f64ce6f79]]
Former-commit-id: e5ba00d370b01f4ed37d24991593852ebd4ed70f [formerly 37c7a8cdd5640db65b5be783c2c888a7f4eb31bb]
Former-commit-id: 9625ac05c0164a9ae1cebb2d450624d039d7139e
This commit is contained in:
cedoor
2022-01-18 13:56:43 +01:00
parent cb2733c356
commit cdf774ec7d
8 changed files with 36 additions and 41 deletions

3
babel.config.json Normal file
View File

@@ -0,0 +1,3 @@
{
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }], "@babel/preset-typescript"]
}

View File

@@ -1,12 +0,0 @@
{
"projects": ["<rootDir>/packages/*"],
"collectCoverageFrom": ["<rootDir>/src/**/*.ts"],
"coverageThreshold": {
"global": {
"branches": 20,
"functions": 30,
"lines": 30,
"statements": 30
}
}
}

26
jest.config.ts Normal file
View File

@@ -0,0 +1,26 @@
import fs from "fs"
import type { Config } from "@jest/types"
const projects = fs
.readdirSync("./packages", { withFileTypes: true })
.filter((directory) => directory.isDirectory())
.map(({ name }) => ({
rootDir: `packages/${name}`,
displayName: name,
moduleNameMapper: {
"@zk-kit/types": "<rootDir>/../../types/zk-kit/index.d.ts"
}
}))
export default async (): Promise<Config.InitialOptions> => ({
projects,
collectCoverageFrom: ["<rootDir>/src/**/*.ts", "!<rootDir>/src/**/index.ts", "!<rootDir>/src/**/*.d.ts"],
coverageThreshold: {
global: {
branches: 20,
functions: 30,
lines: 30,
statements: 30
}
}
})

View File

@@ -7,13 +7,13 @@
"bugs": "https://github.com/appliedzkp/zk-kit/issues",
"private": true,
"scripts": {
"install": "npm run bootstrap && npm run build",
"bootstrap": "lerna bootstrap --no-ci",
"install": "yarn bootstrap && yarn build",
"bootstrap": "lerna bootstrap",
"build": "lerna run build",
"build:watch": "lerna run --parallel build:watch -- -- --watch",
"test": "jest --coverage",
"test:watch": "jest --coverage --watch",
"test:prod": "npm run lint && npm test",
"test:prod": "yarn lint && yarn test",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"prettier": "prettier -c .",
@@ -32,6 +32,9 @@
"circom"
],
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.8",
"@babel/preset-typescript": "^7.16.7",
"@commitlint/cli": "^16.0.2",
"@commitlint/config-conventional": "^16.0.0",
"@rollup/plugin-typescript": "^8.3.0",
@@ -39,6 +42,7 @@
"@types/node": "^17.0.9",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"babel-jest": "^27.4.6",
"benny": "^3.7.1",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
@@ -51,7 +55,6 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"rollup": "^2.64.0",
"ts-jest": "^27.1.3",
"ts-node": "^10.4.0",
"tslib": "^2.3.1",
"typescript": "^4.5.4"

View File

@@ -1,6 +0,0 @@
{
"displayName": "identity",
"transform": {
"\\.ts$": "ts-jest"
}
}

View File

@@ -1,6 +0,0 @@
{
"displayName": "incremental-merkle-tree",
"transform": {
"\\.ts$": "ts-jest"
}
}

View File

@@ -1,7 +0,0 @@
{
"displayName": "protocols",
"transform": {
"\\.ts$": "ts-jest"
},
"preset": "ts-jest/presets/js-with-ts-esm"
}

View File

@@ -1,6 +0,0 @@
{
"displayName": "sparse-merkle-tree",
"transform": {
"\\.ts$": "ts-jest"
}
}