Skip to content

Commit

Permalink
Merge pull request #78 from nautls/complete-tests
Browse files Browse the repository at this point in the history
Complete tests
  • Loading branch information
arobsn authored Sep 20, 2024
2 parents 5545ee5 + 70f9754 commit a7a18fd
Show file tree
Hide file tree
Showing 9 changed files with 394 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"ignorePatterns": ["node_modules", "dist", "coverage", "jest.config.ts"],
"ignorePatterns": ["node_modules", "dist", "coverage", "jest.config.ts", "jest.config.unit.js"],

"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
dist
.DS_Store
.idea

.env
1 change: 1 addition & 0 deletions .jest/setEnvVars.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.ERGO_NODE_ADDRESS = 'http://localhost';
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
preset: "ts-jest",
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],
testPathIgnorePatterns: ["/node_modules/", "/dist/"]
preset: "ts-jest",
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],
testPathIgnorePatterns: ["/node_modules/", "/dist/"]
};
6 changes: 6 additions & 0 deletions jest.config.unit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const baseConfig = require('./jest.config');

module.exports = {
...baseConfig,
setupFiles: ['<rootDir>/.jest/setEnvVars.ts'],
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "src/index.ts",
"scripts": {
"dev": "ts-node-dev --transpile-only --no-notify --exit-child src/index.ts",
"test": "jest",
"test:integration": "jest --testPathPattern=tests/integration*",
"test:unit": "jest --config=jest.config.unit.js --testPathIgnorePatterns=tests/integration*",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"build": "tsc -p tsconfig.json",
"start": "node dist/index.js"
Expand Down
Loading

0 comments on commit a7a18fd

Please sign in to comment.