Skip to content

Commit

Permalink
Setup and configure Jest for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
darlal committed Jul 10, 2021
1 parent 5365508 commit 93982e6
Show file tree
Hide file tree
Showing 5 changed files with 11,258 additions and 4,189 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
.DS_Store
dist/
coverage/

### VisualStudioCode ###
.vscode/*
Expand Down
26 changes: 26 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'js', 'jsx', 'tsx', 'json', 'node'],
roots: ['<rootDir>/src/', 'node_modules'],
modulePaths: ['<rootDir>', 'node_modules'],
moduleDirectories: ['src', 'node_modules'],
moduleNameMapper: {
'src/(.*)': '<rootDir>/src/$1',
obsidian: '<rootDir>/node_modules/obsidian/obsidian.d.ts',
},
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.(ts|tsx)$': 'ts-jest',
},
transformIgnorePatterns: ['\\.pnp\\.[^\\/]+$'],
collectCoverage: true,
coverageThreshold: {
global: {
branches: 20,
functions: 20,
lines: 20,
statements: 20,
},
},
};
Loading

0 comments on commit 93982e6

Please sign in to comment.