Skip to content

Commit aedb1e9

Browse files
authored
refactor: improve angular mount log and override build options for dev (#22955)
1 parent 581b158 commit aedb1e9

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

npm/angular/src/mount.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,17 @@ export function mount<T extends object> (
212212
const fixture = setupFixture(component, testBed, autoDetectChanges)
213213
const componentInstance = setupComponent(config, fixture)
214214

215+
const mountResponse: MountResponse<T> = {
216+
testBed,
217+
fixture,
218+
component: componentInstance,
219+
}
220+
215221
Cypress.log({
216222
name: 'mount',
217223
message: component.name,
224+
consoleProps: () => ({ result: mountResponse }),
218225
})
219226

220-
return cy.wrap({
221-
fixture,
222-
testBed,
223-
component: componentInstance,
224-
}, { log: false })
227+
return cy.wrap(mountResponse, { log: false })
225228
}

npm/webpack-dev-server/src/helpers/angularHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ export function getAngularBuildOptions (projectConfig: AngularJsonProjectConfig,
8585
assets: [],
8686
styles: [],
8787
scripts: [],
88-
budgets: [],
8988
fileReplacements: [],
90-
outputHashing: 'all',
9189
inlineStyleLanguage: 'css',
9290
stylePreprocessorOptions: { includePaths: [] },
9391
resourcesOutputPath: undefined,
@@ -121,6 +119,8 @@ export function getAngularBuildOptions (projectConfig: AngularJsonProjectConfig,
121119
...projectConfig.architect.build.configurations?.development || {},
122120
tsConfig,
123121
aot: false,
122+
outputHashing: 'none',
123+
budgets: undefined,
124124
}
125125
}
126126

npm/webpack-dev-server/test/handlers/angularHandler.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ const expectLoadsAngularBuildOptions = () => {
120120
expect(buildOptions.aot).to.be.false
121121
expect(buildOptions.optimization).to.be.false
122122
expect(buildOptions.tsConfig).to.equal(tsConfig)
123+
expect(buildOptions.outputHashing).to.equal('none')
124+
expect(buildOptions.budgets).to.be.undefined
123125

124126
const modifiedProjectConfig = cloneDeep(projectConfig)
125127

0 commit comments

Comments
 (0)