From aac9b6a43b37c6ffef526f207b9ceab7ca056c2b Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Wed, 27 Feb 2019 11:00:41 +0800 Subject: [PATCH] Remove transform file .js restriction for testUtils 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