feat(cli): add build script and unify tests (#3369)

This commit is contained in:
oddlama 2023-07-21 20:10:01 +02:00 committed by GitHub
parent 0c07c0ba4e
commit f700f3427b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 15 deletions

View file

View file

@ -1,8 +0,0 @@
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
setupFilesAfterEnv: ['jest-extended/all'],
};
export default config;

View file

@ -40,10 +40,29 @@
"yaml": "^2.3.1" "yaml": "^2.3.1"
}, },
"scripts": { "scripts": {
"build": "tsc --project tsconfig.build.json",
"lint": "eslint \"src/**/*.ts\" --max-warnings 0", "lint": "eslint \"src/**/*.ts\" --max-warnings 0",
"prepack": "yarn build ", "prepack": "yarn build ",
"test": "jest", "test": "jest",
"test:cov": "jest --coverage", "test:cov": "jest --coverage",
"format": "prettier --check ." "format": "prettier --check ."
},
"jest": {
"clearMocks": true,
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": ".",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.ts$": "ts-jest"
},
"collectCoverageFrom": [
"<rootDir>/src/**/*.(t|j)s"
],
"coverageDirectory": "./coverage",
"testEnvironment": "node"
} }
} }

View file

@ -1,7 +0,0 @@
{
"extends": "../tsconfig",
"compilerOptions": {
"noEmit": true
},
"references": [{ "path": ".." }]
}

4
cli/tsconfig.build.json Normal file
View file

@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["dist", "node_modules", "upload", "test", "**/*spec.ts"]
}