test(ivy): run compiler compliance tests without rebuilding core,common (#25248)
Previously the compiler compliance tests ran and built test code with real dependencies on @angular/core and @angular/common. This meant that any changes to the compiler would result in long rebuild processes for tests to rerun. This change removes those dependencies and causes test code to be built against the fake_core stub of @angular/core that the ngtsc tests use. This change also removes the dependency on @angular/common entirely, as locality means it's possible to reference *ngIf without needing to link to an implementation. PR Close #25248
This commit is contained in:

committed by
Kara Erickson

parent
afa6b9e794
commit
eb999300d9
@ -602,12 +602,16 @@ export function isInBazel(): boolean {
|
||||
return process.env.TEST_SRCDIR != null;
|
||||
}
|
||||
|
||||
export function setup(
|
||||
options: {compileAngular: boolean, compileAnimations: boolean, compileCommon?: boolean} = {
|
||||
compileAngular: true,
|
||||
compileAnimations: true,
|
||||
compileCommon: false,
|
||||
}) {
|
||||
export function setup(options: {
|
||||
compileAngular: boolean,
|
||||
compileFakeCore?: boolean,
|
||||
compileAnimations: boolean, compileCommon?: boolean
|
||||
} = {
|
||||
compileAngular: true,
|
||||
compileAnimations: true,
|
||||
compileCommon: false,
|
||||
compileFakeCore: false,
|
||||
}) {
|
||||
let angularFiles = new Map<string, string>();
|
||||
|
||||
beforeAll(() => {
|
||||
@ -626,6 +630,11 @@ export function setup(
|
||||
path.join(sources, 'angular/packages/core/npm_package'), 'core', angularFiles,
|
||||
skipDirs);
|
||||
}
|
||||
if (options.compileFakeCore) {
|
||||
readBazelWrittenFilesFrom(
|
||||
path.join(sources, 'angular/packages/compiler-cli/test/ngtsc/fake_core/npm_package'),
|
||||
'core', angularFiles, skipDirs);
|
||||
}
|
||||
if (options.compileAnimations) {
|
||||
// If this fails please add //packages/animations:npm_package as a test data dependency.
|
||||
readBazelWrittenFilesFrom(
|
||||
|
Reference in New Issue
Block a user