Skip to content

Commit 8a53863

Browse files
committed
test: use random devserver ports
1 parent 6e8808e commit 8a53863

File tree

26 files changed

+39
-32
lines changed

26 files changed

+39
-32
lines changed

packages/angular_devkit/build_angular/src/builders/dev-server/specs/works_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Dev Server Builder', () => {
3434
expect(output.success).toBe(true);
3535

3636
// When webpack-dev-server doesn't have `contentBase: false`, this will serve the repo README.
37-
const response = await fetch('http://localhost:4200/README.md', {
37+
const response = await fetch(`http://localhost:${output.port}/README.md`, {
3838
headers: {
3939
'Accept': 'text/html',
4040
},

packages/angular_devkit/build_angular/test/hello-world-app/protractor.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exports.config = {
2323
},
2424
},
2525
directConnect: true,
26-
baseUrl: 'http://localhost:4200/',
26+
baseUrl: 'http://localhost:0/',
2727
framework: 'jasmine',
2828
jasmineNodeOpts: {
2929
showColors: true,

packages/schematics/angular/e2e/files/protractor.conf.js.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports.config = {
1717
},
1818
directConnect: true,
1919
SELENIUM_PROMISE_MANAGER: false,
20-
baseUrl: 'http://localhost:4200/',
20+
baseUrl: 'http://localhost:0/',
2121
framework: 'jasmine',
2222
jasmineNodeOpts: {
2323
showColors: true,

tests/legacy-cli/e2e/assets/12.0-project/e2e/protractor.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exports.config = {
1414
browserName: 'chrome',
1515
},
1616
directConnect: true,
17-
baseUrl: 'http://localhost:4200/',
17+
baseUrl: 'http://localhost:0/',
1818
framework: 'jasmine',
1919
jasmineNodeOpts: {
2020
showColors: true,

tests/legacy-cli/e2e/assets/13.0-project/e2e/protractor.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exports.config = {
1414
browserName: 'chrome',
1515
},
1616
directConnect: true,
17-
baseUrl: 'http://localhost:4200/',
17+
baseUrl: 'http://localhost:0/',
1818
framework: 'jasmine',
1919
jasmineNodeOpts: {
2020
showColors: true,

tests/legacy-cli/e2e/tests/basic/e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export default async function () {
55
await expectToFail(() => silentNg('e2e', 'test-project', '--dev-server-target='));
66

77
// These should work.
8-
await silentNg('e2e', 'test-project');
9-
await silentNg('e2e', 'test-project', '--dev-server-target=test-project:serve');
8+
await silentNg('e2e', '--port=0', 'test-project');
9+
await silentNg('e2e', '--port=0', 'test-project', '--dev-server-target=test-project:serve');
1010
}

tests/legacy-cli/e2e/tests/basic/standalone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ export default async function () {
5454
await ng('build');
5555

5656
// Perform the default E2E tests
57-
await ng('e2e', 'test-project');
57+
await ng('e2e', '--port=0', 'test-project');
5858
}

tests/legacy-cli/e2e/tests/build/lazy-load-syntax.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ export default async function () {
9898
// Both Ivy and View Engine should support it.
9999
await replaceLoadChildren(`() => import('./lazy/lazy.module').then(m => m.LazyModule)`);
100100

101-
await ng('e2e');
102-
await ng('e2e', '--configuration=production');
101+
await ng('e2e', '--port=0');
102+
await ng('e2e', '--port=0', '--configuration=production');
103103
}

tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-aot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export default async function () {
88
await ng('build', 'my-lib', '--configuration=development');
99

1010
// Check that the e2e succeeds prod and non prod mode
11-
await ng('e2e', '--configuration=production');
12-
await ng('e2e', '--configuration=development');
11+
await ng('e2e', '--port=0', '--configuration=production');
12+
await ng('e2e', '--port=0', '--configuration=development');
1313
}

tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-jit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default async function () {
1717
});
1818

1919
// Check that the e2e succeeds prod and non prod mode
20-
await ng('e2e', '--configuration=production');
21-
await ng('e2e', '--configuration=development');
20+
await ng('e2e', '--port=0', '--configuration=production');
21+
await ng('e2e', '--port=0', '--configuration=development');
2222

2323
// Validate that sourcemaps for the library exists.
2424
await ng('build', '--configuration=development');

0 commit comments

Comments
 (0)