Skip to content

Commit

Permalink
test(core): add instance wrapper test
Browse files Browse the repository at this point in the history
ensure mergeWith handles ValueProviders
  • Loading branch information
thiagomini committed Jul 11, 2022
1 parent 62f1fa3 commit 2a7fc84
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/core/test/injector/instance-wrapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,20 @@ describe('InstanceWrapper', () => {
});
});
});

describe('mergeWith', () => {
describe('when provider is a ValueProvider', () => {
it('should provide the given value in the STATIC_CONTEXT', () => {
const wrapper = new InstanceWrapper();
wrapper.mergeWith({
useValue: 'value',
provide: 'token',
});

expect(
wrapper.getInstanceByContextId(STATIC_CONTEXT).instance,
).to.be.equal('value');
});
});
});
});

0 comments on commit 2a7fc84

Please sign in to comment.