Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements a new mutant placing algorithm while also refactoring the instrumenter package.
🔢 New mutant placing algorithm
On the way down: 👇
placementMap
. I call these AST nodes "placement nodes".Statement
applied
method on eachMutant
, providing the placement node. This way the mutant will capture the AST with the single mutation from the placement node down.On the way back up 👆
placementMap
, place them in the AST.🎨 Refactoring
Mutant
now has anapplied
method. Note: passed tense, because it treats the input as immutable.MutantPlacer
's functionality in acanPlace
method and aplace
method. The transformer usescanPlace
to identity the placement nodes.array
of mutants. Instead, it returns anIterable
of replacement nodes.Iterable
, since this allows us to use generator functions. You can simplyyield
mutants when needed. This cleans up the code nicelybabel-transformer
into multiple methodsbabel-transformer
unit tests now use test doubles instead of sinon stubs. This makes for a more robust - black box - unit test experience.Fixes #2968