Skip to content

Commit

Permalink
fix: fix espwoer-typescript inject logic (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse authored Jun 23, 2022
1 parent 627d956 commit 2e0fecd
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 2e0fecd

Please sign in to comment.