Skip to content

Commit

Permalink
add jest.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiago Bustamante committed Feb 22, 2020
1 parent a2167a5 commit 53990b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.js
*.js.map
*.d.ts
!test/*.js
doc
node_modules
.vscode
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ You need to configure those sources only once, but before you try to use the obj

You can also put all manual container configurations in an external file and the use the '''ContainerConfig''' class to import them.

For example, you can create the config file:
For example, you can create the ```ioc.config.ts``` file:

```typescript
import { MyType, MyTypeImpl, MyType2, MyType2Provider } from './my-types';
Expand All @@ -380,7 +380,7 @@ And then import the configurations using:

```typescript
import { ContainerConfig } from "typescript-ioc/container-config";
import config from './ioc-configurations.ts';
import config from './ioc.config';

ContainerConfig.configure(config);
```
Expand Down
29 changes: 29 additions & 0 deletions test/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
testEnvironment: 'node',
transform: {
"^.+\\.tsx?$": "ts-jest"
},
moduleFileExtensions: [
"ts",
"tsx",
"js",
"jsx",
"json",
"node",
],
testRegex: '(/unit/.*|(\\.|/)(test|spec))\\.(ts|js)x?$',
coverageDirectory: 'reports/coverage',
collectCoverageFrom: [
'src/**/*.{ts,tsx,js,jsx}',
'!src/**/*.d.ts',
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
},
rootDir: '../'
};

0 comments on commit 53990b0

Please sign in to comment.