From 389b6d079923ee49ff02192a87c9d198f80c4437 Mon Sep 17 00:00:00 2001 From: Alessandro Bianco Date: Fri, 19 Nov 2021 18:41:01 +0100 Subject: [PATCH] Update ignore globs depending on compile configuration (fix #33) --- index.js | 4 ++-- test/snapshots/protocol-ava-3.2.js.md | 2 +- test/snapshots/protocol-ava-3.2.js.snap | Bin 756 -> 753 bytes 3 files changed, 3 insertions(+), 3 deletions(-) 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 df5d750c263db1c2bb8361d6bada36e5e552c2a5..2d4b337f287ad9f7d7b41050cf70b81ec09d2e11 100644 GIT binary patch literal 753 zcmVQ7ILxRUbEZ zo4alAc9)$^+8~083Vw|G?sxIYC*Sl#_~_jAE~zPfD5ZZO4J^CK%XIUA+=2T z8mT&DWQL5T9Dqf<{0=WA-_dB7hxA2Pa|n#kw(ziRa^Go78QR!r)ag3sG`3d5vhPR2 z#_eW3P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