Skip to content

Commit

Permalink
test: 👷 update jest and ts configs
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jul 23, 2023
1 parent f028e5e commit 039b195
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 51 deletions.
32 changes: 32 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { JestConfigWithTsJest } from 'ts-jest';

const jestConfig: JestConfigWithTsJest = {
testEnvironment: 'node',
transform: {
'\\.(js|ts|jsx|tsx)$': 'babel-jest',
},
testPathIgnorePatterns: ['<rootDir>/dist', '<rootDir>/lib', '<rootDir>/scripts', '<rootDir>/coverage'],
transformIgnorePatterns: ['dist', 'scripts', 'coverage'],
testMatch: ['**/?(*.)+(spec|test).?(m)[jt]s?(x)'],
moduleFileExtensions: ['js', 'mjs', 'ts'],
// setupFiles: [''],
coverageDirectory: '<rootDir>/coverage',
moduleDirectories: ['node_modules', 'offline'],
modulePathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/coverage/',
'<rootDir>/dist/',
'<rootDir>/scripts/',
'<rootDir>/test/sgp4/sgp4prop',
],
moduleNameMapper: {
'^@lib(.*)$': '<rootDir>/lib/$1',
'^@dist(.*)$': '<rootDir>/dist/$1',
'^@src(.*)$': '<rootDir>/src/$1',
'^@test(.*)$': '<rootDir>/test/$1',
},
coverageReporters: ['lcov', 'html', 'text'],
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/lib/', '/scripts/', '/coverage/'],
};

export default jestConfig;
14 changes: 0 additions & 14 deletions scripts/jest-std.json

This file was deleted.

11 changes: 0 additions & 11 deletions test/jsconfig.json

This file was deleted.

Empty file removed test/setup.js
Empty file.
31 changes: 31 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"typeAcquisition": {
"enable": true
},
"compilerOptions": {
"target": "es5",
"module": "es6",
"lib": ["esnext"],
"declaration": true,
// "noImplicitAny": true,
// "removeComments": true,
"baseUrl": ".",
"paths": {
"@lib/*": ["lib/*"],
"@dist/*": ["dist/*"],
"@src/*": ["src/*"],
"@test/*": ["test/*"]
},
"allowJs": true,
"experimentalDecorators": true,
"rootDir": ".",
"sourceMap": true,
"listFiles": true,
"newLine": "LF",
"skipLibCheck": true,
// "noEmitOnError": true,
"types": ["jest", "node"],
"moduleResolution": "Node",
"esModuleInterop": true
}
}
14 changes: 14 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This is the tsconfig extension that only applies to webpack.
*/
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist" /* Redirect output structure to the directory. */,
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
},
"include": ["./src/**/*.ts"],
"filesGlob": ["./src/**/*.ts"],
"ignorePatterns": ["./src/sgp4/asc/**/*.ts"],
"exclude": ["./src/sgp4/asc/assembly/index.ts"]
}
33 changes: 7 additions & 26 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
/**
* This is the tsconfig extension that is used by the IDE.
*/
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "es5",
"module": "es6",
"outDir": "./lib",
"lib": ["esnext", "WebWorker"],
// "allowJs": true,
"declaration": true,
// "noImplicitAny": true,
// "removeComments": true,
"baseUrl": ".",
"paths": {
"@lib/*": ["lib/*"],
"@dist/*": ["dist/*"],
"@src/*": ["src/*"],
"@test/*": ["test/*"]
},
"allowJs": true,
"experimentalDecorators": true,
"rootDir": "./src",
"sourceMap": true,
"listFiles": true,
"newLine": "LF",
"skipLibCheck": true,
"noEmitOnError": true,
"types": []
"noEmit": true
},
"include": ["./src/**/*.ts"],
"filesGlob": ["./src/**/*.ts"],
"include": ["./src/**/*.ts", "./test/**/*.ts"],
"filesGlob": ["./src/**/*.ts", "./test/**/*.ts"],
"ignorePatterns": ["./src/sgp4/asc/**/*.ts"],
"exclude": ["./src/sgp4/asc/assembly/index.ts"]
}

0 comments on commit 039b195

Please sign in to comment.