Skip to content

Commit 0b700c3

Browse files
clydinKeen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular-devkit/build-angular): protractor should use dev server baseUrl
1 parent e3eee5f commit 0b700c3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/angular_devkit/build_angular/src/protractor/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ async function execute(
140140
}
141141
const clientUrl = url.parse(publicHost);
142142
baseUrl = url.format(clientUrl);
143+
} else if (typeof result.baseUrl === 'string') {
144+
baseUrl = result.baseUrl;
143145
} else if (typeof result.port === 'number') {
144146
baseUrl = url.format({
145147
protocol: serverOptions.ssl ? 'https' : 'http',

packages/angular_devkit/build_angular/test/protractor/works_spec_large.ts

+16
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,20 @@ describe('Protractor Builder', () => {
8181
await run.stop();
8282
}, 30000);
8383

84+
it('supports dev server builder with browser builder base HREF option', async () => {
85+
host.replaceInFile(
86+
'angular.json',
87+
'"main": "src/main.ts",',
88+
'"main": "src/main.ts", "baseHref": "/base/",',
89+
);
90+
// Need to reset architect to use the modified config
91+
architect = (await createArchitect(host.root())).architect;
92+
93+
const run = await architect.scheduleTarget(protractorTargetSpec);
94+
95+
await expectAsync(run.result).toBeResolvedTo(jasmine.objectContaining({ success: true }));
96+
97+
await run.stop();
98+
}, 30000);
99+
84100
});

0 commit comments

Comments
 (0)