@travetto/di
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -24,3 +24,3 @@ { | ||
}, | ||
"version": "0.0.18" | ||
"version": "0.0.19" | ||
} |
@@ -48,7 +48,7 @@ import { Injectable, Inject, InjectableFactory } from '../src'; | ||
export const CUSTOM_SERVICE_INHERIT = Symbol('Custom'); | ||
export const CUSTOM_DATABSE = Symbol('CUSTOM DB'); | ||
export const CUSTOM_DATABASE = Symbol('CUSTOM DB'); | ||
export const CUSTOM_EMPTY = Symbol('Custom EMPTY'); | ||
class TestConfig { | ||
@InjectableFactory({ qualifier: CUSTOM_EMPTY, class: DbConfig }) | ||
@InjectableFactory(CUSTOM_EMPTY) | ||
static getNewDb(): DbConfig<any, any> { | ||
@@ -74,3 +74,3 @@ const out = new DbConfig(); | ||
@InjectableFactory(CUSTOM_DATABSE) | ||
@InjectableFactory(CUSTOM_DATABASE) | ||
static getCustomDB(config: DbConfig<any, any>, @Inject(CUSTOM_EMPTY) empty: Empty): Database { | ||
@@ -77,0 +77,0 @@ console.log('Custom EMPTY 2', empty); |
import { DependencyRegistry } from '../src/service'; | ||
import { ServiceInherit, SERVICE_INHERIT_2, CUSTOM_SERVICE_INHERIT, CUSTOM_DATABSE, Database, CUSTOM_EMPTY } from './deps'; | ||
import { ServiceInherit, SERVICE_INHERIT_2, CUSTOM_SERVICE_INHERIT, CUSTOM_DATABASE, Database, CUSTOM_EMPTY } from './deps'; | ||
import { Suite, Test, BeforeEach } from '@travetto/test'; | ||
@@ -84,5 +84,5 @@ import * as assert from 'assert'; | ||
assert(inst.age === 12); | ||
assert(inst.age === 11); | ||
assert(inst.db.dbConfig === undefined); | ||
// assert(inst.db.dbConfig === undefined); | ||
@@ -99,3 +99,3 @@ assert(inst.db.dbConfig); | ||
const inst = await DependencyRegistry.getInstance(Database, CUSTOM_DATABSE); | ||
const inst = await DependencyRegistry.getInstance(Database, CUSTOM_DATABASE); | ||
@@ -102,0 +102,0 @@ assert(inst); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30646