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 ClassProviders
  • Loading branch information
thiagomini committed Jul 11, 2022
1 parent 2a7fc84 commit 7696f43
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/core/test/injector/instance-wrapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,5 +449,18 @@ describe('InstanceWrapper', () => {
).to.be.equal('value');
});
});

describe('when provider is a ClassProvider', () => {
it('should alter the instance wrapper metatype with the given class', () => {
const wrapper = new InstanceWrapper();

wrapper.mergeWith({
useClass: TestClass,
provide: 'token',
});

expect(wrapper.metatype).to.be.eql(TestClass);
});
});
});
});

0 comments on commit 7696f43

Please sign in to comment.