-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(instrument): should return unmodified source if no transform fou…
…nd (#1036) * Test that the instrument command returns unmodified source if there is no transform found for a file extension. Currently this behaviour can only be reached when trying to instrument a single file. In the case of instrumenting a directory, files with an extension with no matching transform are filtered out before they can be instrumented. * Cleanup instrumentation code again with a focus on paths The main aim of this has been to clarify whether we're working with relative or absolute file paths, and removing unnecessary transformations. Although I've made a few other 'small' changes here and there. Key changes: * Created a new private method `NYC._transform`, common to `_maybeInstrumentSource` and `instrumentAllFiles`. * Renamed the param in `walkAllFiles` forEach handler to `relFile` to explicitly state the file representation being used. * Let the `addAllFiles` visitor function rely on `testExclude` to determine which files to instrument
- Loading branch information
1 parent
1f6c3d4
commit 5c1eb38
Showing
3 changed files
with
57 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var a = 0 | ||
|
||
a++ | ||
|
||
if (a === 0) { | ||
a++; | ||
a--; | ||
a++; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters