Skip to content

Commit a008d52

Browse files
committed
use jest-ts
1 parent e26fc8d commit a008d52

File tree

4 files changed

+1101
-1107
lines changed

4 files changed

+1101
-1107
lines changed

package.json

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,30 @@
4040
},
4141
"devDependencies": {
4242
"@types/glob": "^7.1.1",
43+
"@types/jest": "^24.0.15",
4344
"@types/mkdirp": "^0.5.1",
44-
"@types/node": "^12.0.3",
45+
"@types/node": "^12.0.8",
4546
"@types/yargs": "^8.0.2",
46-
"jest": "^23.6.0",
47+
"jest": "^24.8.0",
48+
"ts-jest": "^24.0.2",
4749
"typescript": "^3.5.1"
4850
},
4951
"jest": {
50-
"transform": {}
52+
"transform": {
53+
"^.+\\.ts$": "ts-jest"
54+
},
55+
"testRegex": "(test/.*|(src/.*\\.test))\\.ts$",
56+
"testPathIgnorePatterns": [
57+
"/node_modules/",
58+
"\\.d\\.ts$",
59+
"lib/",
60+
"example/",
61+
"coverage/"
62+
],
63+
"moduleFileExtensions": [
64+
"js",
65+
"ts",
66+
"json"
67+
]
5168
}
5269
}

test/dtsCreator.spec.js renamed to test/dts-creator.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use strict';
22

3-
var path = require('path');
4-
var assert = require('assert');
5-
var DtsCreator = require('../lib/dts-creator').DtsCreator;
6-
var os = require('os');
3+
import * as path from 'path';
4+
5+
import * as assert from 'assert';
6+
import * as os from 'os';
7+
import { DtsCreator } from '../src/dts-creator';
78

89
describe('DtsCreator', () => {
910
var creator = new DtsCreator();

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
"module": "commonjs",
44
"target": "es2015",
55
"declaration": true,
6-
"sourceMap": false,
6+
"sourceMap": true,
77
"strict": true,
88
"noImplicitAny": true,
99
"resolveJsonModule": true,
1010
"esModuleInterop": true,
11-
"outDir": "lib"
11+
"outDir": "lib",
12+
"allowSyntheticDefaultImports": true
1213
},
1314
"include": [
1415
"src/**/*.ts"

0 commit comments

Comments
 (0)