@samitouri / QOS-React / commits / efb6d80e60

match jest.d.ts by regex

Dmitrii Abramov committed May 18, 2016 at 21:51 UTC efb6d80e60e400f1d6b4549099939cf334afa687
1 file changed +3 -1
scripts/jest/ts-preprocessor.js
+3 -1
@@ -31,11 +31,13 @@ function compile(content, contentFilename) {
31 path.join('/', '(?:React|ReactDOM)(?:\.d)?\.ts$')
32 );
33
34 + var jestRegex = /jest\.d\.ts/;
35 +
36 if (filename === 'lib.d.ts') {
37 source = fs.readFileSync(
38 require.resolve('typescript/lib/lib.d.ts')
39 ).toString();
38 - } else if (filename === 'jest.d.ts') {
40 + } else if (filename.match(jestRegex)) {
41 source = fs.readFileSync(
42 path.join(__dirname, 'jest.d.ts')
43 ).toString();