Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/angular_devkit/build_angular/src/dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface DevServerBuilderOptions {
vendorChunk?: boolean;
commonChunk?: boolean;
baseHref?: string;
deployUrl?: string;
progress?: boolean;
poll?: number;
verbose?: boolean;
Expand Down Expand Up @@ -406,6 +407,7 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
'progress',
'poll',
'verbose',
'deployUrl',
];

// remove options that are undefined or not to be overrriden
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

import { request, runTargetSpec } from '@angular-devkit/architect/testing';
import { from } from 'rxjs';
import { concatMap, take, tap } from 'rxjs/operators';
import { DevServerBuilderOptions } from '../../src';
import { devServerTargetSpec, host } from '../utils';


describe('Dev Server Deploy Url', () => {
beforeEach(done => host.initialize().toPromise().then(done, done.fail));
afterEach(done => host.restore().toPromise().then(done, done.fail));

it('works', (done) => {
const overrides: Partial<DevServerBuilderOptions> = { deployUrl: 'test/' };

runTargetSpec(host, devServerTargetSpec, overrides).pipe(
tap((buildEvent) => expect(buildEvent.success).toBe(true)),
concatMap(() => from(request('http://localhost:4200/test/polyfills.js'))),
tap(response => expect(response).toContain('window["webpackJsonp"]')),
take(1),
).toPromise().then(done, done.fail);
}, 30000);
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ describe('Dev Server Builder serve path', () => {
beforeEach(done => host.initialize().toPromise().then(done, done.fail));
afterEach(done => host.restore().toPromise().then(done, done.fail));

// TODO: review this test, it seems to pass with or without the servePath.
it('works', (done) => {
const overrides: Partial<DevServerBuilderOptions> = { servePath: 'test/' };

runTargetSpec(host, devServerTargetSpec, overrides).pipe(
tap((buildEvent) => expect(buildEvent.success).toBe(true)),
concatMap(() => from(request('http://localhost:4200/test/'))),
tap(response => expect(response).toContain('<title>HelloWorldApp</title>')),
concatMap(() => from(request('http://localhost:4200/test/abc/'))),
tap(response => expect(response).toContain('<title>HelloWorldApp</title>')),
concatMap(() => from(request('http://localhost:4200/test/polyfills.js'))),
tap(response => expect(response).toContain('window["webpackJsonp"]')),
take(1),
).toPromise().then(done, done.fail);
}, 30000);
Expand Down