feat(testing): add testing module [wip]

This commit is contained in:
hansputera
2021-11-08 22:11:12 +07:00
parent 1b32dc1789
commit f9eafe8352
4 changed files with 3093 additions and 17 deletions

10
babel.config.js Normal file
View File

@@ -0,0 +1,10 @@
module.exports = {
'presets': [
['@babel/preset-env', {
'targets': {
'node': 'current',
},
}],
'@babel/preset-typescript',
],
};

22
jest.config.ts Normal file
View File

@@ -0,0 +1,22 @@
import type {Config} from '@jest/types';
export default async (): Promise<Config.InitialOptions> => {
return {
'verbose': true,
'clearMocks': true,
'collectCoverage': true,
'coverageDirectory': 'tests__coverages',
'maxConcurrency': 2,
'watchPathIgnorePatterns': [
'./node_modules/',
'./lib/',
],
'testEnvironment': 'node',
'testMatch': [
'**/tests/**/*.+(ts)',
],
'transform': {
'^.+\\.(ts)$': 'ts-jest',
},
};
};

View File

@@ -9,12 +9,19 @@
"ow": "^0.28.1"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@types/ioredis": "^4.28.1",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"@vercel/node": "^1.12.1",
"babel-jest": "^27.3.1",
"eslint": "^8.2.0",
"eslint-config-google": "^0.14.0",
"jest": "^27.3.1",
"ts-node": "^10.4.0",
"typescript": "^4.4.4"
},
"scripts": {

3071
yarn.lock

File diff suppressed because it is too large Load Diff