Skip to content

Commit 28f8a04

Browse files
committed
test: fix tests so it fails when servePath is not working
This is due that when targeting an html file, when it doesn't exists it redirects to the root page. So instead use a `js` files to test
1 parent 4ff095a commit 28f8a04

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/angular_devkit/build_angular/test/dev-server/serve-path_spec_large.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ describe('Dev Server Builder serve path', () => {
1717
beforeEach(done => host.initialize().toPromise().then(done, done.fail));
1818
afterEach(done => host.restore().toPromise().then(done, done.fail));
1919

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

2423
runTargetSpec(host, devServerTargetSpec, overrides).pipe(
2524
tap((buildEvent) => expect(buildEvent.success).toBe(true)),
26-
concatMap(() => from(request('http://localhost:4200/test/'))),
27-
tap(response => expect(response).toContain('<title>HelloWorldApp</title>')),
28-
concatMap(() => from(request('http://localhost:4200/test/abc/'))),
29-
tap(response => expect(response).toContain('<title>HelloWorldApp</title>')),
25+
concatMap(() => from(request('http://localhost:4200/test/polyfills.js'))),
26+
tap(response => expect(response).toContain('window["webpackJsonp"]')),
3027
take(1),
3128
).toPromise().then(done, done.fail);
3229
}, 30000);

0 commit comments

Comments
 (0)