From 6585dd1f9b0d4c2ad122cc4c8d568365de0a2873 Mon Sep 17 00:00:00 2001 From: Christopher Darroch Date: Sat, 4 Jul 2020 10:50:51 +0200 Subject: [PATCH] fix(compiler): fix transitive module dependencies in unit tests (#2178) (#2549) --- src/compiler/transpile.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/transpile.ts b/src/compiler/transpile.ts index 72332383936..57c92265ce5 100644 --- a/src/compiler/transpile.ts +++ b/src/compiler/transpile.ts @@ -124,7 +124,8 @@ const transpileJson = (results: TranspileResults) => { results.map = { mappings: '' }; }; -const shouldTranspileModule = (ext: string) => ext === 'tsx' || ext === 'ts' || ext === 'jsx' || ext === 'mjs'; +// @todo: could/should this be borrowed from either tsconfig's allowJs or jest config's ? +const shouldTranspileModule = (ext: string) => ['tsx', 'ts', 'mjs', 'jsx', 'js'].includes(ext); export const compile = (code: string, opts: any = {}): Promise => { console.warn(`compile() deprecated, please use transpile() instead`);