Skip to content

Commit fef31e0

Browse files
sumitaroradond2clouds
authored andcommitted
fix(@angular/cli): fix baseUrl when running e2e with no-serve
1 parent 05ea82c commit fef31e0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/@angular/cli/tasks/e2e.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export const E2eTask = Task.extend({
3232
hostname: e2eTaskOptions.host,
3333
port: e2eTaskOptions.port.toString()
3434
});
35+
} else if (e2eTaskOptions.baseHref) {
36+
additionalProtractorConfig.baseUrl = e2eTaskOptions.baseHref;
3537
}
3638

3739
if (e2eTaskOptions.specs.length !== 0) {

tests/e2e/tests/test/e2e-baseurl.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { ng, killAllProcesses } from '../../utils/process';
2+
import { expectToFail } from '../../utils/utils';
3+
4+
export default function () {
5+
return Promise.resolve()
6+
.then(() => ng('serve', '--port', '4400'))
7+
.then(() => expectToFail(() => ng('e2e')))
8+
.then(() => ng('e2e', '--no-serve', '--base-url=http://localhost:4400'))
9+
.then(() => killAllProcesses(), (err: any) => {
10+
killAllProcesses();
11+
throw err;
12+
});
13+
}

0 commit comments

Comments
 (0)