From 036d62a362cc85304b6f68f70c924799782d09de Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Thu, 7 Mar 2019 07:08:36 +0800 Subject: [PATCH] Remove transform file .js restriction for testUtils (#308) 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'. --- src/testUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testUtils.js b/src/testUtils.js index 5fe24c42..7ccbf4ff 100644 --- a/src/testUtils.js +++ b/src/testUtils.js @@ -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