Skip to content

Commit 7696f43

Browse files
committed
test(core): add instance wrapper test
ensure mergeWith handles ClassProviders
1 parent 2a7fc84 commit 7696f43

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/core/test/injector/instance-wrapper.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,5 +449,18 @@ describe('InstanceWrapper', () => {
449449
).to.be.equal('value');
450450
});
451451
});
452+
453+
describe('when provider is a ClassProvider', () => {
454+
it('should alter the instance wrapper metatype with the given class', () => {
455+
const wrapper = new InstanceWrapper();
456+
457+
wrapper.mergeWith({
458+
useClass: TestClass,
459+
provide: 'token',
460+
});
461+
462+
expect(wrapper.metatype).to.be.eql(TestClass);
463+
});
464+
});
452465
});
453466
});

0 commit comments

Comments
 (0)