Skip to content

Commit

Permalink
fix: fix espwoer-typescript inject logic (#178) (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse authored Jun 23, 2022
1 parent 3e6cc45 commit d7e1eff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cmd/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ class TestCommand extends Command {

// for power-assert
if (testArgv.typescript && testArgv.espower) {
requireArr.splice(requireArr.indexOf(testArgv.tscompiler), 1);
if (requireArr.includes(testArgv.tscompiler)) {
requireArr.splice(requireArr.indexOf(testArgv.tscompiler), 1);
}
requireArr.push(testArgv.tscompiler, require.resolve('../espower-typescript'));
}

Expand Down

0 comments on commit d7e1eff

Please sign in to comment.