@@ -4,6 +4,7 @@ import 'mocha';
4
4
import * as chai from 'chai' ;
5
5
import "reflect-metadata" ;
6
6
import * as IoC from "../../src/typescript-ioc" ;
7
+ import { ContainerConfig } from "../../src/container-config" ;
7
8
8
9
const expect = chai . expect ;
9
10
@@ -174,8 +175,12 @@ describe("Inheritance on autowired types", () => {
174
175
175
176
it ( "should inject all fields from all types and call all constructors" , ( ) => {
176
177
const instance : Teste2 = new Teste2 ( ) ;
178
+ const instance2 : Teste2 = new Teste2 ( ) ;
179
+ instance2 . abc = 234 ;
177
180
expect ( instance . property1 ) . to . exist ;
178
181
expect ( instance . property2 ) . to . exist ;
182
+ expect ( instance . abc ) . to . eq ( 123 ) ;
183
+ expect ( instance2 . abc ) . to . eq ( 234 ) ;
179
184
expect ( constructorsCalled ) . to . include . members ( [ 'TesteAbstract' , 'Teste1' , 'Teste2' ] ) ;
180
185
} ) ;
181
186
@@ -382,6 +387,8 @@ describe("The IoC Container Config.to()", () => {
382
387
describe ( "The IoC Container" , ( ) => {
383
388
384
389
it ( "should find classes in different files" , ( ) => {
390
+ ContainerConfig . addSource ( 'data/*' , 'test' ) ;
391
+
385
392
const Worker = require ( '../data/classes' ) . Worker ;
386
393
const instance = new Worker ( ) ;
387
394
expect ( instance ) . to . exist ;
0 commit comments