Skip to content

Commit

Permalink
Remove transform file .js restriction for testUtils (#308)
Browse files Browse the repository at this point in the history
Since we are able to write transformers in TS, the .js extension hard coded in testUtils not allow us to use it to write tests for TS transform modules.
And `require('some-module')` will automatically infer some-module's extension whether it is ended with '.js' or '.ts', it should be safe to remove ',js'.
  • Loading branch information
pengx17 authored and fkling committed Mar 6, 2019
1 parent ec3ab98 commit 036d62a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/testUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function runTest(dirName, transformName, options, testFilePrefix) {
'utf8'
);
// Assumes transform is one level up from __tests__ directory
const module = require(path.join(dirName, '..', transformName + '.js'));
const module = require(path.join(dirName, '..', transformName));
runInlineTest(module, options, {
path: inputPath,
source
Expand Down

0 comments on commit 036d62a

Please sign in to comment.