diff --git a/index.js b/index.js index ad5983c..d160f33 100644 --- a/index.js +++ b/index.js @@ -115,7 +115,7 @@ export default function typescriptProvider({negotiateProtocol}) { return false; } - return rewritePaths.some(([from]) => filePath.startsWith(from)); + return rewritePaths.some(([to, from]) => filePath.startsWith(compile === 'tsc' ? from : to)); }, resolveTestFile(testfile) { @@ -142,7 +142,7 @@ export default function typescriptProvider({negotiateProtocol}) { ], ignoredByWatcherPatterns: [ ...ignoredByWatcherPatterns, - ...Object.values(relativeRewritePaths).map(to => `${to}**/*.js.map`), + ...Object.entries(relativeRewritePaths).map(([to, from]) => `${compile === 'tsc' ? from : to}**`), ], }; }, diff --git a/test/snapshots/protocol-ava-3.2.js.md b/test/snapshots/protocol-ava-3.2.js.md index 89878f9..b693d62 100644 --- a/test/snapshots/protocol-ava-3.2.js.md +++ b/test/snapshots/protocol-ava-3.2.js.md @@ -110,6 +110,6 @@ Generated by [AVA](https://avajs.dev). ], ignoredByWatcherPatterns: [ 'assets/**', - 'build/**/*.js.map', + 'src/**', ], } diff --git a/test/snapshots/protocol-ava-3.2.js.snap b/test/snapshots/protocol-ava-3.2.js.snap index df5d750..2d4b337 100644 Binary files a/test/snapshots/protocol-ava-3.2.js.snap and b/test/snapshots/protocol-ava-3.2.js.snap differ