refactor: improve angular mount log and override build options for dev (#22955)

This commit is contained in:
Zachary Williams
2022-07-28 10:23:45 -05:00
committed by GitHub
parent 581b158742
commit aedb1e93f9
3 changed files with 12 additions and 7 deletions

View File

@@ -212,14 +212,17 @@ export function mount<T extends object> (
const fixture = setupFixture(component, testBed, autoDetectChanges)
const componentInstance = setupComponent(config, fixture)
const mountResponse: MountResponse<T> = {
testBed,
fixture,
component: componentInstance,
}
Cypress.log({
name: 'mount',
message: component.name,
consoleProps: () => ({ result: mountResponse }),
})
return cy.wrap({
fixture,
testBed,
component: componentInstance,
}, { log: false })
return cy.wrap(mountResponse, { log: false })
}

View File

@@ -85,9 +85,7 @@ export function getAngularBuildOptions (projectConfig: AngularJsonProjectConfig,
assets: [],
styles: [],
scripts: [],
budgets: [],
fileReplacements: [],
outputHashing: 'all',
inlineStyleLanguage: 'css',
stylePreprocessorOptions: { includePaths: [] },
resourcesOutputPath: undefined,
@@ -121,6 +119,8 @@ export function getAngularBuildOptions (projectConfig: AngularJsonProjectConfig,
...projectConfig.architect.build.configurations?.development || {},
tsConfig,
aot: false,
outputHashing: 'none',
budgets: undefined,
}
}

View File

@@ -120,6 +120,8 @@ const expectLoadsAngularBuildOptions = () => {
expect(buildOptions.aot).to.be.false
expect(buildOptions.optimization).to.be.false
expect(buildOptions.tsConfig).to.equal(tsConfig)
expect(buildOptions.outputHashing).to.equal('none')
expect(buildOptions.budgets).to.be.undefined
const modifiedProjectConfig = cloneDeep(projectConfig)