test(compiler-cli): skip compliance tests that target ES5 for partial compilation tests (#39707)
The linker does not currently support outputting ES5 syntax, so any compliance tests that request ES5 output cannot be run in partial compilation mode. This commit marks these tests as pending. PR Close #39707
This commit is contained in:
parent
2484ba4f05
commit
f4690cb527
|
@ -15,6 +15,7 @@ ts_library(
|
|||
"@npm//@types/babel__core",
|
||||
"@npm//@types/babel__generator",
|
||||
"@npm//@types/babel__template",
|
||||
"@npm//typescript",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {PluginObj, transformSync} from '@babel/core';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {createEs2015LinkerPlugin} from '../../../linker/babel';
|
||||
import {compileFiles, CompileFn, setCompileFn} from '../mock_compile';
|
||||
|
@ -19,6 +20,12 @@ import {compileFiles, CompileFn, setCompileFn} from '../mock_compile';
|
|||
* This should produce the same output as the full AOT compilation
|
||||
*/
|
||||
const linkedCompile: CompileFn = (data, angularFiles, options) => {
|
||||
if (options !== undefined && options.target !== undefined &&
|
||||
options.target < ts.ScriptTarget.ES2015) {
|
||||
pending('ES5 is not supported in the partial compilation tests');
|
||||
throw new Error('ES5 is not supported in the partial compilation tests');
|
||||
}
|
||||
|
||||
const compiledFiles = compileFiles(data, angularFiles, {...options, compilationMode: 'partial'});
|
||||
|
||||
const linkerPlugin = createEs2015LinkerPlugin({
|
||||
|
|
Loading…
Reference in New Issue