Skip to content

Commit

Permalink
test: fix invalid architect tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Mar 15, 2019
1 parent c85e404 commit deeea03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/angular_devkit/architect/src/index2_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ describe('architect', () => {
testArchitectHost = new TestingArchitectHost();
architect = new Architect(testArchitectHost, registry);

options = {};
called = 0;
testArchitectHost.addBuilder('package:test', createBuilder(async () => {
testArchitectHost.addBuilder('package:test', createBuilder(async o => {
called++;
options = o;

return new Promise<BuilderOutput>(resolve => {
setTimeout(() => resolve({ success: true }), 10);
Expand Down Expand Up @@ -93,13 +95,15 @@ describe('architect', () => {
const run = await architect.scheduleBuilder('package:test-options', o);
expect(await run.result).toEqual(jasmine.objectContaining({ success: true }));
expect(options).toEqual(o);
await run.stop();
});

it('passes options to targets', async () => {
const o = { helloTarget: 'world' };
const run = await architect.scheduleTarget(target1, o);
expect(await run.result).toEqual(jasmine.objectContaining({ success: true }));
// FIXME(hansl): expect(options).toEqual(o);
expect(options).toEqual(o);
await run.stop();
});

it('errors when builder cannot be resolved', async () => {
Expand Down

0 comments on commit deeea03

Please sign in to comment.