From aedb1e93f98619684ddd3e12a0da24b1dde664b4 Mon Sep 17 00:00:00 2001 From: Zachary Williams Date: Thu, 28 Jul 2022 10:23:45 -0500 Subject: [PATCH] refactor: improve angular mount log and override build options for dev (#22955) --- npm/angular/src/mount.ts | 13 ++++++++----- .../src/helpers/angularHandler.ts | 4 ++-- .../test/handlers/angularHandler.spec.ts | 2 ++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/npm/angular/src/mount.ts b/npm/angular/src/mount.ts index 996b0bf984..15a41bdca9 100644 --- a/npm/angular/src/mount.ts +++ b/npm/angular/src/mount.ts @@ -212,14 +212,17 @@ export function mount ( const fixture = setupFixture(component, testBed, autoDetectChanges) const componentInstance = setupComponent(config, fixture) + const mountResponse: MountResponse = { + 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 }) } diff --git a/npm/webpack-dev-server/src/helpers/angularHandler.ts b/npm/webpack-dev-server/src/helpers/angularHandler.ts index 974dafbeb0..9d0887f156 100644 --- a/npm/webpack-dev-server/src/helpers/angularHandler.ts +++ b/npm/webpack-dev-server/src/helpers/angularHandler.ts @@ -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, } } diff --git a/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts b/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts index 647f2308db..98d69dc919 100644 --- a/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts +++ b/npm/webpack-dev-server/test/handlers/angularHandler.spec.ts @@ -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)