Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): protractor should use dev server …
Browse files Browse the repository at this point in the history
…baseUrl
  • Loading branch information
clydin authored and Keen Yee Liau committed May 9, 2019
1 parent deacee0 commit 2b72b58
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/angular_devkit/build_angular/src/protractor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ async function execute(
}
const clientUrl = url.parse(publicHost);
baseUrl = url.format(clientUrl);
} else if (typeof result.baseUrl === 'string') {
baseUrl = result.baseUrl;
} else if (typeof result.port === 'number') {
baseUrl = url.format({
protocol: serverOptions.ssl ? 'https' : 'http',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,20 @@ describe('Protractor Builder', () => {
await run.stop();
}, 30000);

it('supports dev server builder with browser builder base HREF option', async () => {
host.replaceInFile(
'angular.json',
'"main": "src/main.ts",',
'"main": "src/main.ts", "baseHref": "/base/",',
);
// Need to reset architect to use the modified config
architect = (await createArchitect(host.root())).architect;

const run = await architect.scheduleTarget(protractorTargetSpec);

await expectAsync(run.result).toBeResolvedTo(jasmine.objectContaining({ success: true }));

await run.stop();
}, 30000);

});

0 comments on commit 2b72b58

Please sign in to comment.