You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{projectDir, babelConfig}=this.options;constcompileEnhancements=this.options.compileEnhancements!==false;constprecompileFull=babelConfig ?
babelPipeline.build(projectDir,cacheDir,babelConfig,compileEnhancements) :
filename=>{thrownewError(`Cannot apply full precompilation, possible bad usage: ${filename}`);};constprecompileEnhancementsOnly=compileEnhancements&&this.options.extensions.enhancementsOnly.length>0 ?
babelPipeline.build(projectDir,cacheDir,null,compileEnhancements) :
filename=>{thrownewError(`Cannot apply enhancement-only precompilation, possible bad usage: ${filename}`);};this._precompiler={
cacheDir,enabled: babelConfig||compileEnhancements,
precompileEnhancementsOnly,
precompileFull
};
Note how this._precompiler.enabled ends up being true. However precompileEnhancementsOnly is set to a function that always throws. Consequently, when compiling TypeScript files, precompileEnhancementsOnly is called and AVA crashes.
I think the logic should be such that a () => null function is when compileEnhancements is false, and the error-throwing function is used when it's not and this.options.extensions.enhancementsOnly.length is 0.
The text was updated successfully, but these errors were encountered:
From #1822 (comment):
Because of how
ts
is specified, AVA won't apply its Babel pipeline to it. However, note that thebabel
option is not disabled.The logic in these lines is broken:
Note how
this._precompiler.enabled
ends up beingtrue
. HoweverprecompileEnhancementsOnly
is set to a function that always throws. Consequently, when compiling TypeScript files,precompileEnhancementsOnly
is called and AVA crashes.I think the logic should be such that a
() => null
function is whencompileEnhancements
isfalse
, and the error-throwing function is used when it's not andthis.options.extensions.enhancementsOnly.length
is0
.The text was updated successfully, but these errors were encountered: