diff --git a/.auditignore b/.auditignore deleted file mode 100644 index f30365bff..000000000 --- a/.auditignore +++ /dev/null @@ -1,2 +0,0 @@ -https://nodesecurity.io/advisories/118 -https://nodesecurity.io/advisories/577 \ No newline at end of file diff --git a/.npmignore b/.npmignore index d88fd69cd..0677e1839 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,3 @@ -.auditignore .github .gitignore .nyc_output @@ -14,6 +13,7 @@ ISSUE_TEMPLATE.md lib/esm/**/*.d.ts.map !lib/esm/index.d.ts !lib/esm/index.d.ts.map +lib/*/test/** mocha.opts prettier.config.mjs PULL_REQUEST_TEMPLATE.md @@ -22,7 +22,6 @@ rollup.config.mjs scripts src temp -test tsconfig.json tsconfig.base.cjs.json tsconfig.base.esm.json diff --git a/mocha.opts b/mocha.opts deleted file mode 100644 index fb8a3a2a2..000000000 --- a/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---require reflect-metadata/Reflect ---watch-extensions ts -dist/test/**/*.test.js diff --git a/package.json b/package.json index 676441dfc..9cb617e03 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,8 @@ "lint": "eslint ./src", "prebuild": "npm run build:clean", "prepublish": "npm run build", - "test": "nyc --reporter=lcov --require ts-node/register mocha ./test/*.test.ts test/**/*.test.ts --reporter spec --retries 3 --require 'node_modules/reflect-metadata/Reflect.js' --exit" + "test": "nyc --reporter=lcov --require ts-node/register mocha src/test/*.test.ts src/test/**/*.test.ts --reporter spec --require 'node_modules/reflect-metadata/Reflect.js' --exit", + "test:cjs": "nyc --reporter=lcov mocha lib/cjs/test/*.test.js lib/cjs/test/**/*.test.js --reporter spec --require 'node_modules/reflect-metadata/Reflect.js'" }, "sideEffects": false, "version": "6.1.5" diff --git a/test/annotation/decorator_utils.test.ts b/src/test/annotation/decorator_utils.test.ts similarity index 95% rename from test/annotation/decorator_utils.test.ts rename to src/test/annotation/decorator_utils.test.ts index 72ee51be6..13d88fb06 100644 --- a/test/annotation/decorator_utils.test.ts +++ b/src/test/annotation/decorator_utils.test.ts @@ -6,10 +6,10 @@ import { DecoratorTarget, tagParameter, tagProperty, -} from '../../src/annotation/decorator_utils'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { Container, inject, injectable, interfaces } from '../../src/index'; -import { Metadata } from '../../src/planning/metadata'; +} from '../../annotation/decorator_utils'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { Container, inject, injectable, interfaces } from '../../index'; +import { Metadata } from '../../planning/metadata'; describe('createTaggedDecorator', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/annotation/inject.test.ts b/src/test/annotation/inject.test.ts similarity index 95% rename from test/annotation/inject.test.ts rename to src/test/annotation/inject.test.ts index 184189319..36f3ecffb 100644 --- a/test/annotation/inject.test.ts +++ b/src/test/annotation/inject.test.ts @@ -14,12 +14,12 @@ declare function __param( import { LazyServiceIdentifier } from '@inversifyjs/common'; import { expect } from 'chai'; -import { decorate } from '../../src/annotation/decorator_utils'; -import { inject } from '../../src/annotation/inject'; -import { multiInject } from '../../src/annotation/multi_inject'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import type { interfaces } from '../../src/interfaces/interfaces'; +import { decorate } from '../../annotation/decorator_utils'; +import { inject } from '../../annotation/inject'; +import { multiInject } from '../../annotation/multi_inject'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import type { interfaces } from '../../interfaces/interfaces'; class Katana {} class Shuriken {} diff --git a/test/annotation/injectable.test.ts b/src/test/annotation/injectable.test.ts similarity index 90% rename from test/annotation/injectable.test.ts rename to src/test/annotation/injectable.test.ts index 4b7f51d14..e6066d4dd 100644 --- a/test/annotation/injectable.test.ts +++ b/src/test/annotation/injectable.test.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import * as ERRORS_MSGS from '../../src/constants/error_msgs'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import { decorate, injectable } from '../../src/index'; +import * as ERRORS_MSGS from '../../constants/error_msgs'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import { decorate, injectable } from '../../index'; describe('@injectable', () => { it('Should generate metadata if declared injections', () => { diff --git a/test/annotation/multi_inject.test.ts b/src/test/annotation/multi_inject.test.ts similarity index 93% rename from test/annotation/multi_inject.test.ts rename to src/test/annotation/multi_inject.test.ts index 36a485eed..f0c06607d 100644 --- a/test/annotation/multi_inject.test.ts +++ b/src/test/annotation/multi_inject.test.ts @@ -13,11 +13,11 @@ declare function __param( import { expect } from 'chai'; -import { decorate } from '../../src/annotation/decorator_utils'; -import { multiInject } from '../../src/annotation/multi_inject'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import type { interfaces } from '../../src/interfaces/interfaces'; +import { decorate } from '../../annotation/decorator_utils'; +import { multiInject } from '../../annotation/multi_inject'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import type { interfaces } from '../../interfaces/interfaces'; type Weapon = object; diff --git a/test/annotation/named.test.ts b/src/test/annotation/named.test.ts similarity index 95% rename from test/annotation/named.test.ts rename to src/test/annotation/named.test.ts index f4ca530f0..401bffc63 100644 --- a/test/annotation/named.test.ts +++ b/src/test/annotation/named.test.ts @@ -13,11 +13,11 @@ declare function __param( import { expect } from 'chai'; -import { decorate } from '../../src/annotation/decorator_utils'; -import { named } from '../../src/annotation/named'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import type { interfaces } from '../../src/interfaces/interfaces'; +import { decorate } from '../../annotation/decorator_utils'; +import { named } from '../../annotation/named'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import type { interfaces } from '../../interfaces/interfaces'; type Weapon = unknown; diff --git a/test/annotation/optional.test.ts b/src/test/annotation/optional.test.ts similarity index 98% rename from test/annotation/optional.test.ts rename to src/test/annotation/optional.test.ts index 48660542f..6dc904355 100644 --- a/test/annotation/optional.test.ts +++ b/src/test/annotation/optional.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container, inject, injectable, optional } from '../../src/index'; +import { Container, inject, injectable, optional } from '../../index'; describe('@optional', () => { it('Should allow to flag dependencies as optional', () => { diff --git a/test/annotation/post_construct.test.ts b/src/test/annotation/post_construct.test.ts similarity index 84% rename from test/annotation/post_construct.test.ts rename to src/test/annotation/post_construct.test.ts index 789529b81..d14f3b968 100644 --- a/test/annotation/post_construct.test.ts +++ b/src/test/annotation/post_construct.test.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; -import { postConstruct } from '../../src/annotation/post_construct'; -import * as ERRORS_MSGS from '../../src/constants/error_msgs'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import { decorate } from '../../src/index'; -import { Metadata } from '../../src/planning/metadata'; +import { postConstruct } from '../../annotation/post_construct'; +import * as ERRORS_MSGS from '../../constants/error_msgs'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import { decorate } from '../../index'; +import { Metadata } from '../../planning/metadata'; describe('@postConstruct', () => { it('Should generate metadata for the decorated method', () => { diff --git a/test/annotation/tagged.test.ts b/src/test/annotation/tagged.test.ts similarity index 96% rename from test/annotation/tagged.test.ts rename to src/test/annotation/tagged.test.ts index 60a8f0026..1d54ffb0e 100644 --- a/test/annotation/tagged.test.ts +++ b/src/test/annotation/tagged.test.ts @@ -13,11 +13,11 @@ declare function __param( import { expect } from 'chai'; -import { decorate } from '../../src/annotation/decorator_utils'; -import { tagged } from '../../src/annotation/tagged'; -import * as ERRORS_MSGS from '../../src/constants/error_msgs'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import type { interfaces } from '../../src/interfaces/interfaces'; +import { decorate } from '../../annotation/decorator_utils'; +import { tagged } from '../../annotation/tagged'; +import * as ERRORS_MSGS from '../../constants/error_msgs'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import type { interfaces } from '../../interfaces/interfaces'; type Weapon = unknown; diff --git a/test/annotation/target_name.test.ts b/src/test/annotation/target_name.test.ts similarity index 87% rename from test/annotation/target_name.test.ts rename to src/test/annotation/target_name.test.ts index 5e784da00..aac939e7a 100644 --- a/test/annotation/target_name.test.ts +++ b/src/test/annotation/target_name.test.ts @@ -1,11 +1,11 @@ import { expect } from 'chai'; -import { decorate } from '../../src/annotation/decorator_utils'; -import { injectable } from '../../src/annotation/injectable'; -import { targetName } from '../../src/annotation/target_name'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import type { interfaces } from '../../src/index'; -import { Metadata } from '../../src/planning/metadata'; +import { decorate } from '../../annotation/decorator_utils'; +import { injectable } from '../../annotation/injectable'; +import { targetName } from '../../annotation/target_name'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import type { interfaces } from '../../index'; +import { Metadata } from '../../planning/metadata'; import * as Stubs from '../utils/stubs'; describe('@targetName', () => { diff --git a/test/bindings/binding.test.ts b/src/test/bindings/binding.test.ts similarity index 83% rename from test/bindings/binding.test.ts rename to src/test/bindings/binding.test.ts index a27733499..590dc854c 100644 --- a/test/bindings/binding.test.ts +++ b/src/test/bindings/binding.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { Binding } from '../../src/bindings/binding'; -import { BindingScopeEnum } from '../../src/constants/literal_types'; +import { Binding } from '../../bindings/binding'; +import { BindingScopeEnum } from '../../constants/literal_types'; import * as Stubs from '../utils/stubs'; describe('Binding', () => { diff --git a/test/bugs/bugs.test.ts b/src/test/bugs/bugs.test.ts similarity index 98% rename from test/bugs/bugs.test.ts rename to src/test/bugs/bugs.test.ts index 91496b304..be81bd344 100644 --- a/test/bugs/bugs.test.ts +++ b/src/test/bugs/bugs.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import * as METADATA_KEY from '../../constants/metadata_keys'; import { Container, decorate, @@ -13,14 +13,14 @@ import { tagged, targetName, unmanaged, -} from '../../src/index'; -import { Metadata } from '../../src/planning/metadata'; -import { MetadataReader } from '../../src/planning/metadata_reader'; -import { getDependencies } from '../../src/planning/reflection_utils'; +} from '../../index'; +import { Metadata } from '../../planning/metadata'; +import { MetadataReader } from '../../planning/metadata_reader'; +import { getDependencies } from '../../planning/reflection_utils'; import { getFunctionName, getServiceIdentifierAsString, -} from '../../src/utils/serialization'; +} from '../../utils/serialization'; describe('Bugs', () => { it('Should throw when args length of base and derived class not match', () => { diff --git a/test/bugs/issue_1190.test.ts b/src/test/bugs/issue_1190.test.ts similarity index 94% rename from test/bugs/issue_1190.test.ts rename to src/test/bugs/issue_1190.test.ts index 894f8be8b..1a6984570 100644 --- a/test/bugs/issue_1190.test.ts +++ b/src/test/bugs/issue_1190.test.ts @@ -1,12 +1,6 @@ import { expect } from 'chai'; -import { - Container, - inject, - injectable, - named, - optional, -} from '../../src/index'; +import { Container, inject, injectable, named, optional } from '../../index'; describe('Issue 1190', () => { it('should inject a katana as default weapon to ninja', () => { diff --git a/test/bugs/issue_1297.test.ts b/src/test/bugs/issue_1297.test.ts similarity index 98% rename from test/bugs/issue_1297.test.ts rename to src/test/bugs/issue_1297.test.ts index fb42f4b6a..fcab9738d 100644 --- a/test/bugs/issue_1297.test.ts +++ b/src/test/bugs/issue_1297.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { Container, injectable, interfaces } from '../../src/index'; +import { Container, injectable, interfaces } from '../../index'; describe('Issue 1297', () => { it('should call onActivation once if the service is a constant value binding', () => { diff --git a/test/bugs/issue_1416.test.ts b/src/test/bugs/issue_1416.test.ts similarity index 92% rename from test/bugs/issue_1416.test.ts rename to src/test/bugs/issue_1416.test.ts index 262691d66..826daa730 100644 --- a/test/bugs/issue_1416.test.ts +++ b/src/test/bugs/issue_1416.test.ts @@ -1,7 +1,7 @@ import { describe, it } from 'mocha'; import sinon from 'sinon'; -import { Container, injectable, preDestroy } from '../../src/index'; +import { Container, injectable, preDestroy } from '../../index'; describe('Issue 1416', () => { it('should allow providing default values on optional bindings', async () => { diff --git a/test/bugs/issue_1515.test.ts b/src/test/bugs/issue_1515.test.ts similarity index 98% rename from test/bugs/issue_1515.test.ts rename to src/test/bugs/issue_1515.test.ts index 2ed2c6008..19e818a97 100644 --- a/test/bugs/issue_1515.test.ts +++ b/src/test/bugs/issue_1515.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container, inject, injectable, multiInject } from '../../src/index'; +import { Container, inject, injectable, multiInject } from '../../index'; describe('Issue 1515', () => { it('should properly throw on circular dependency', () => { diff --git a/test/bugs/issue_1518.test.ts b/src/test/bugs/issue_1518.test.ts similarity index 90% rename from test/bugs/issue_1518.test.ts rename to src/test/bugs/issue_1518.test.ts index 2896cf698..30250b51f 100644 --- a/test/bugs/issue_1518.test.ts +++ b/src/test/bugs/issue_1518.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container } from '../../src/index'; +import { Container } from '../../index'; describe('Issue 1518', () => { it('should not throw on deactivating undefined singleton values', () => { diff --git a/test/bugs/issue_1564.test.ts b/src/test/bugs/issue_1564.test.ts similarity index 94% rename from test/bugs/issue_1564.test.ts rename to src/test/bugs/issue_1564.test.ts index 9d5d334aa..fa4cdb32f 100644 --- a/test/bugs/issue_1564.test.ts +++ b/src/test/bugs/issue_1564.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { describe, it } from 'mocha'; -import { Container, inject, injectable } from '../../src/index'; +import { Container, inject, injectable } from '../../index'; describe('Issue 1564', () => { it('should not throw on getting async services bound using "toService"', async () => { diff --git a/test/bugs/issue_543.test.ts b/src/test/bugs/issue_543.test.ts similarity index 94% rename from test/bugs/issue_543.test.ts rename to src/test/bugs/issue_543.test.ts index fb69672b9..7397afd14 100644 --- a/test/bugs/issue_543.test.ts +++ b/src/test/bugs/issue_543.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { Container, inject, injectable } from '../../src/index'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { Container, inject, injectable } from '../../index'; describe('Issue 543', () => { it('Should throw correct circular dependency path', () => { diff --git a/test/bugs/issue_549.test.ts b/src/test/bugs/issue_549.test.ts similarity index 96% rename from test/bugs/issue_549.test.ts rename to src/test/bugs/issue_549.test.ts index 7c2360842..d7f5f0943 100644 --- a/test/bugs/issue_549.test.ts +++ b/src/test/bugs/issue_549.test.ts @@ -1,5 +1,5 @@ -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { Container, inject, injectable, interfaces } from '../../src/index'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { Container, inject, injectable, interfaces } from '../../index'; describe('Issue 549', () => { it('Should throw if circular dependencies found with dynamics', () => { diff --git a/test/bugs/issue_633.test.ts b/src/test/bugs/issue_633.test.ts similarity index 94% rename from test/bugs/issue_633.test.ts rename to src/test/bugs/issue_633.test.ts index 4adf598c7..37fa9cca0 100644 --- a/test/bugs/issue_633.test.ts +++ b/src/test/bugs/issue_633.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container, injectable, interfaces } from '../../src/index'; +import { Container, injectable, interfaces } from '../../index'; describe('Issue 633', () => { it('Should expose metadata through context', () => { diff --git a/test/bugs/issue_706.test.ts b/src/test/bugs/issue_706.test.ts similarity index 91% rename from test/bugs/issue_706.test.ts rename to src/test/bugs/issue_706.test.ts index b6198eb37..0ca51823e 100644 --- a/test/bugs/issue_706.test.ts +++ b/src/test/bugs/issue_706.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { BindingScopeEnum, Container, injectable } from '../../src/index'; +import { BindingScopeEnum, Container, injectable } from '../../index'; describe('Issue 706', () => { it('Should expose BindingScopeEnum as part of the public API', () => { diff --git a/test/bugs/issue_928.test.ts b/src/test/bugs/issue_928.test.ts similarity index 94% rename from test/bugs/issue_928.test.ts rename to src/test/bugs/issue_928.test.ts index 3e54f38ce..547ab2880 100644 --- a/test/bugs/issue_928.test.ts +++ b/src/test/bugs/issue_928.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container, inject, injectable, optional } from '../../src/index'; +import { Container, inject, injectable, optional } from '../../index'; describe('Issue 928', () => { it('should inject the right instances', () => { diff --git a/test/constants/error_message.test.ts b/src/test/constants/error_message.test.ts similarity index 94% rename from test/constants/error_message.test.ts rename to src/test/constants/error_message.test.ts index d0791202f..590c253b3 100644 --- a/test/constants/error_message.test.ts +++ b/src/test/constants/error_message.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; +import * as ERROR_MSGS from '../../constants/error_msgs'; describe('ERROR_MSGS', () => { it('Should be able to customize POST_CONSTRUCT_ERROR', () => { diff --git a/test/container/container.test.ts b/src/test/container/container.test.ts similarity index 98% rename from test/container/container.test.ts rename to src/test/container/container.test.ts index 144864ac7..4e7f109d6 100644 --- a/test/container/container.test.ts +++ b/src/test/container/container.test.ts @@ -1,17 +1,17 @@ import { assert, expect } from 'chai'; import * as sinon from 'sinon'; -import { inject } from '../../src/annotation/inject'; -import { injectable } from '../../src/annotation/injectable'; -import { postConstruct } from '../../src/annotation/post_construct'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { BindingScopeEnum } from '../../src/constants/literal_types'; -import { Container } from '../../src/container/container'; -import { ContainerModule } from '../../src/container/container_module'; -import { ModuleActivationStore } from '../../src/container/module_activation_store'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { getBindingDictionary } from '../../src/planning/planner'; -import { getServiceIdentifierAsString } from '../../src/utils/serialization'; +import { inject } from '../../annotation/inject'; +import { injectable } from '../../annotation/injectable'; +import { postConstruct } from '../../annotation/post_construct'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { BindingScopeEnum } from '../../constants/literal_types'; +import { Container } from '../../container/container'; +import { ContainerModule } from '../../container/container_module'; +import { ModuleActivationStore } from '../../container/module_activation_store'; +import type { interfaces } from '../../interfaces/interfaces'; +import { getBindingDictionary } from '../../planning/planner'; +import { getServiceIdentifierAsString } from '../../utils/serialization'; type Dictionary = Map< interfaces.ServiceIdentifier, diff --git a/test/container/container_module.test.ts b/src/test/container/container_module.test.ts similarity index 98% rename from test/container/container_module.test.ts rename to src/test/container/container_module.test.ts index 5199e19ea..bea8241e8 100644 --- a/test/container/container_module.test.ts +++ b/src/test/container/container_module.test.ts @@ -1,13 +1,13 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { NOT_REGISTERED } from '../../src/constants/error_msgs'; -import { Container } from '../../src/container/container'; +import { NOT_REGISTERED } from '../../constants/error_msgs'; +import { Container } from '../../container/container'; import { AsyncContainerModule, ContainerModule, -} from '../../src/container/container_module'; -import type { interfaces } from '../../src/interfaces/interfaces'; +} from '../../container/container_module'; +import type { interfaces } from '../../interfaces/interfaces'; describe('ContainerModule', () => { it('Should be able to set the registry of a container module', () => { diff --git a/test/container/lookup.test.ts b/src/test/container/lookup.test.ts similarity index 96% rename from test/container/lookup.test.ts rename to src/test/container/lookup.test.ts index 3b28e3f7a..96b443f50 100644 --- a/test/container/lookup.test.ts +++ b/src/test/container/lookup.test.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; -import { Binding } from '../../src/bindings/binding'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { BindingScopeEnum } from '../../src/constants/literal_types'; -import { Lookup } from '../../src/container/lookup'; -import type { interfaces } from '../../src/interfaces/interfaces'; +import { Binding } from '../../bindings/binding'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { BindingScopeEnum } from '../../constants/literal_types'; +import { Lookup } from '../../container/lookup'; +import type { interfaces } from '../../interfaces/interfaces'; class ClonableValue implements interfaces.Clonable> { public readonly val: T; diff --git a/test/container/module_activation_store.test.ts b/src/test/container/module_activation_store.test.ts similarity index 98% rename from test/container/module_activation_store.test.ts rename to src/test/container/module_activation_store.test.ts index e4fde4547..6e0d5d0df 100644 --- a/test/container/module_activation_store.test.ts +++ b/src/test/container/module_activation_store.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { ModuleActivationStore } from '../../src/container/module_activation_store'; -import type { interfaces } from '../../src/index'; +import { ModuleActivationStore } from '../../container/module_activation_store'; +import type { interfaces } from '../../index'; describe('ModuleActivationStore', () => { it('should remove handlers added by the module', () => { diff --git a/test/features/metadata_reader.test.ts b/src/test/features/metadata_reader.test.ts similarity index 98% rename from test/features/metadata_reader.test.ts rename to src/test/features/metadata_reader.test.ts index 610934150..8e35f230f 100644 --- a/test/features/metadata_reader.test.ts +++ b/src/test/features/metadata_reader.test.ts @@ -1,9 +1,9 @@ import { expect } from 'chai'; -import * as METADATA_KEY from '../../src/constants/metadata_keys'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { Container, inject, injectable, MetadataReader } from '../../src/index'; -import { Metadata } from '../../src/planning/metadata'; +import * as METADATA_KEY from '../../constants/metadata_keys'; +import { Container, inject, injectable, MetadataReader } from '../../index'; +import type { interfaces } from '../../interfaces/interfaces'; +import { Metadata } from '../../planning/metadata'; describe('Custom Metadata Reader', () => { interface FunctionWithMetadata extends NewableFunction { diff --git a/test/features/named_default.test.ts b/src/test/features/named_default.test.ts similarity index 97% rename from test/features/named_default.test.ts rename to src/test/features/named_default.test.ts index af2e741b8..ff4119b71 100644 --- a/test/features/named_default.test.ts +++ b/src/test/features/named_default.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container, inject, injectable, named } from '../../src/index'; +import { Container, inject, injectable, named } from '../../index'; describe('Named default', () => { it('Should be able to inject a default to avoid ambiguous binding exceptions', () => { diff --git a/test/features/property_injection.test.ts b/src/test/features/property_injection.test.ts similarity index 99% rename from test/features/property_injection.test.ts rename to src/test/features/property_injection.test.ts index 712ece4cb..45bde8db6 100644 --- a/test/features/property_injection.test.ts +++ b/src/test/features/property_injection.test.ts @@ -9,7 +9,7 @@ import { optional, tagged, unmanaged, -} from '../../src/index'; +} from '../../index'; describe('Property Injection', () => { it('Should be able to inject a property', () => { diff --git a/test/features/provider.test.ts b/src/test/features/provider.test.ts similarity index 99% rename from test/features/provider.test.ts rename to src/test/features/provider.test.ts index e02b45ad2..fbdb0d74a 100644 --- a/test/features/provider.test.ts +++ b/src/test/features/provider.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container, injectable, interfaces } from '../../src/index'; +import { Container, injectable, interfaces } from '../../index'; describe('Provider', () => { it('Should support complex asynchronous initialization processes', (done: Mocha.Done) => { diff --git a/test/features/request_scope.test.ts b/src/test/features/request_scope.test.ts similarity index 98% rename from test/features/request_scope.test.ts rename to src/test/features/request_scope.test.ts index e433bb391..42f20338c 100644 --- a/test/features/request_scope.test.ts +++ b/src/test/features/request_scope.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { performance } from 'perf_hooks'; -import { Container, inject, injectable, named } from '../../src/index'; +import { Container, inject, injectable, named } from '../../index'; describe('inRequestScope', () => { it('Should support request scope in basic bindings', () => { diff --git a/test/features/resolve_unbinded.test.ts b/src/test/features/resolve_unbinded.test.ts similarity index 98% rename from test/features/resolve_unbinded.test.ts rename to src/test/features/resolve_unbinded.test.ts index 69f3bf2e4..6cabccf04 100644 --- a/test/features/resolve_unbinded.test.ts +++ b/src/test/features/resolve_unbinded.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Container, injectable, interfaces } from '../../src/index'; +import { Container, injectable, interfaces } from '../../index'; describe('Container.prototype.resolve', () => { it('Should be able to resolve a class that has not binded', () => { diff --git a/test/features/transitive_bindings.test.ts b/src/test/features/transitive_bindings.test.ts similarity index 99% rename from test/features/transitive_bindings.test.ts rename to src/test/features/transitive_bindings.test.ts index 776b52206..c392f2674 100644 --- a/test/features/transitive_bindings.test.ts +++ b/src/test/features/transitive_bindings.test.ts @@ -5,7 +5,7 @@ import { injectable, interfaces, multiBindToService, -} from '../../src/index'; +} from '../../index'; describe('Transitive bindings', () => { it('Should be able to bind to a service', () => { diff --git a/test/inversify.test.ts b/src/test/inversify.test.ts similarity index 99% rename from test/inversify.test.ts rename to src/test/inversify.test.ts index f88171bd6..52b903941 100644 --- a/test/inversify.test.ts +++ b/src/test/inversify.test.ts @@ -1,9 +1,8 @@ /* eslint-disable @typescript-eslint/no-unnecessary-type-parameters */ import { expect } from 'chai'; -import { DecoratorTarget } from '../src/annotation/decorator_utils'; -import * as ERROR_MSGS from '../src/constants/error_msgs'; -import type { interfaces } from '../src/interfaces/interfaces'; +import { DecoratorTarget } from '../annotation/decorator_utils'; +import * as ERROR_MSGS from '../constants/error_msgs'; import { Container, ContainerModule, @@ -17,7 +16,8 @@ import { targetName, typeConstraint, unmanaged, -} from '../src/index'; +} from '../index'; +import type { interfaces } from '../interfaces/interfaces'; describe('InversifyJS', () => { it('Should be able to resolve and inject dependencies', () => { diff --git a/test/middleware/middleware.test.ts b/src/test/middleware/middleware.test.ts similarity index 97% rename from test/middleware/middleware.test.ts rename to src/test/middleware/middleware.test.ts index cf4ba9190..128a48bee 100644 --- a/test/middleware/middleware.test.ts +++ b/src/test/middleware/middleware.test.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { injectable } from '../../src/annotation/injectable'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { Container } from '../../src/container/container'; -import type { interfaces } from '../../src/interfaces/interfaces'; +import { injectable } from '../../annotation/injectable'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { Container } from '../../container/container'; +import type { interfaces } from '../../interfaces/interfaces'; describe('Middleware', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/node/error_messages.test.ts b/src/test/node/error_messages.test.ts similarity index 96% rename from test/node/error_messages.test.ts rename to src/test/node/error_messages.test.ts index c3f7fb370..ed917eebe 100644 --- a/test/node/error_messages.test.ts +++ b/src/test/node/error_messages.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { Container, injectable } from '../../src/index'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { Container, injectable } from '../../index'; describe('Error message when resolving fails', () => { @injectable() diff --git a/test/node/exceptions.test.ts b/src/test/node/exceptions.test.ts similarity index 88% rename from test/node/exceptions.test.ts rename to src/test/node/exceptions.test.ts index bbfaa4cdd..5360b52b0 100644 --- a/test/node/exceptions.test.ts +++ b/src/test/node/exceptions.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { Container, inject, injectable } from '../../src/index'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { Container, inject, injectable } from '../../index'; describe('Node', () => { it('Should throw if circular dependencies found', () => { diff --git a/test/node/performance.test.ts b/src/test/node/performance.test.ts similarity index 98% rename from test/node/performance.test.ts rename to src/test/node/performance.test.ts index 951280235..3ece461f0 100644 --- a/test/node/performance.test.ts +++ b/src/test/node/performance.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { performance } from 'perf_hooks'; -import { Container } from '../../src/index'; +import { Container } from '../../index'; describe('Performance', () => { function registerN(times: number) { diff --git a/test/node/proxies.test.ts b/src/test/node/proxies.test.ts similarity index 92% rename from test/node/proxies.test.ts rename to src/test/node/proxies.test.ts index d3e66c760..b3f4fa74a 100644 --- a/test/node/proxies.test.ts +++ b/src/test/node/proxies.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { Container, inject, injectable } from '../../src/index'; +import { Container, inject, injectable } from '../../index'; +import type { interfaces } from '../../interfaces/interfaces'; describe('InversifyJS', () => { it('Should support the injection of proxied objects', () => { diff --git a/test/planning/context.test.ts b/src/test/planning/context.test.ts similarity index 83% rename from test/planning/context.test.ts rename to src/test/planning/context.test.ts index 92a66fcb1..4fed2ebfa 100644 --- a/test/planning/context.test.ts +++ b/src/test/planning/context.test.ts @@ -1,11 +1,11 @@ import { ClassElementMetadataKind, LegacyTargetImpl } from '@inversifyjs/core'; import { expect } from 'chai'; -import { TargetTypeEnum } from '../../src/constants/literal_types'; -import { Container } from '../../src/container/container'; -import { Context } from '../../src/planning/context'; -import { Plan } from '../../src/planning/plan'; -import { Request } from '../../src/planning/request'; +import { TargetTypeEnum } from '../../constants/literal_types'; +import { Container } from '../../container/container'; +import { Context } from '../../planning/context'; +import { Plan } from '../../planning/plan'; +import { Request } from '../../planning/request'; describe('Context', () => { it('Should set its own properties correctly', () => { diff --git a/test/planning/metadata.test.ts b/src/test/planning/metadata.test.ts similarity index 81% rename from test/planning/metadata.test.ts rename to src/test/planning/metadata.test.ts index 3493a12ca..92510eafa 100644 --- a/test/planning/metadata.test.ts +++ b/src/test/planning/metadata.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { Metadata } from '../../src/planning/metadata'; +import { Metadata } from '../../planning/metadata'; describe('Metadata', () => { it('Should set its own properties correctly', () => { diff --git a/test/planning/plan.test.ts b/src/test/planning/plan.test.ts similarity index 80% rename from test/planning/plan.test.ts rename to src/test/planning/plan.test.ts index 512482828..51a5f9815 100644 --- a/test/planning/plan.test.ts +++ b/src/test/planning/plan.test.ts @@ -1,11 +1,11 @@ import { ClassElementMetadataKind, LegacyTargetImpl } from '@inversifyjs/core'; import { expect } from 'chai'; -import { TargetTypeEnum } from '../../src/constants/literal_types'; -import { Container } from '../../src/container/container'; -import { Context } from '../../src/planning/context'; -import { Plan } from '../../src/planning/plan'; -import { Request } from '../../src/planning/request'; +import { TargetTypeEnum } from '../../constants/literal_types'; +import { Container } from '../../container/container'; +import { Context } from '../../planning/context'; +import { Plan } from '../../planning/plan'; +import { Request } from '../../planning/request'; describe('Plan', () => { it('Should set its own properties correctly', () => { diff --git a/test/planning/planner.test.ts b/src/test/planning/planner.test.ts similarity index 96% rename from test/planning/planner.test.ts rename to src/test/planning/planner.test.ts index 6b9ce383f..271ee5d2b 100644 --- a/test/planning/planner.test.ts +++ b/src/test/planning/planner.test.ts @@ -1,19 +1,19 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { inject } from '../../src/annotation/inject'; -import { injectable } from '../../src/annotation/injectable'; -import { multiInject } from '../../src/annotation/multi_inject'; -import { tagged } from '../../src/annotation/tagged'; -import { targetName } from '../../src/annotation/target_name'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { TargetTypeEnum } from '../../src/constants/literal_types'; -import { Container } from '../../src/container/container'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { named } from '../../src/index'; -import { MetadataReader } from '../../src/planning/metadata_reader'; -import { Plan } from '../../src/planning/plan'; -import { plan } from '../../src/planning/planner'; +import { inject } from '../../annotation/inject'; +import { injectable } from '../../annotation/injectable'; +import { multiInject } from '../../annotation/multi_inject'; +import { tagged } from '../../annotation/tagged'; +import { targetName } from '../../annotation/target_name'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { TargetTypeEnum } from '../../constants/literal_types'; +import { Container } from '../../container/container'; +import { named } from '../../index'; +import type { interfaces } from '../../interfaces/interfaces'; +import { MetadataReader } from '../../planning/metadata_reader'; +import { Plan } from '../../planning/plan'; +import { plan } from '../../planning/planner'; describe('Planner', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/planning/queryable_string.test.ts b/src/test/planning/queryable_string.test.ts similarity index 96% rename from test/planning/queryable_string.test.ts rename to src/test/planning/queryable_string.test.ts index 1099730cd..918bba2f3 100644 --- a/test/planning/queryable_string.test.ts +++ b/src/test/planning/queryable_string.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { QueryableString } from '../../src/planning/queryable_string'; +import { QueryableString } from '../../planning/queryable_string'; describe('QueryableString', () => { it('Should be able to set its own properties', () => { diff --git a/test/planning/request.test.ts b/src/test/planning/request.test.ts similarity index 91% rename from test/planning/request.test.ts rename to src/test/planning/request.test.ts index 29188b253..e8d3bdb9d 100644 --- a/test/planning/request.test.ts +++ b/src/test/planning/request.test.ts @@ -4,11 +4,11 @@ import { } from '@inversifyjs/core'; import { expect } from 'chai'; -import { TargetTypeEnum } from '../../src/constants/literal_types'; -import { Container } from '../../src/container/container'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { Context } from '../../src/planning/context'; -import { Request } from '../../src/planning/request'; +import { TargetTypeEnum } from '../../constants/literal_types'; +import { Container } from '../../container/container'; +import type { interfaces } from '../../interfaces/interfaces'; +import { Context } from '../../planning/context'; +import { Request } from '../../planning/request'; describe('Request', () => { // eslint-disable-next-line @typescript-eslint/typedef diff --git a/test/resolution/resolver.test.ts b/src/test/resolution/resolver.test.ts similarity index 98% rename from test/resolution/resolver.test.ts rename to src/test/resolution/resolver.test.ts index 806528463..7493d8eee 100644 --- a/test/resolution/resolver.test.ts +++ b/src/test/resolution/resolver.test.ts @@ -1,25 +1,22 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { inject } from '../../src/annotation/inject'; -import { injectable } from '../../src/annotation/injectable'; -import { multiInject } from '../../src/annotation/multi_inject'; -import { named } from '../../src/annotation/named'; -import { postConstruct } from '../../src/annotation/post_construct'; -import { preDestroy } from '../../src/annotation/pre_destroy'; -import { tagged } from '../../src/annotation/tagged'; -import { targetName } from '../../src/annotation/target_name'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; -import { - BindingTypeEnum, - TargetTypeEnum, -} from '../../src/constants/literal_types'; -import { Container } from '../../src/container/container'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { MetadataReader } from '../../src/planning/metadata_reader'; -import { getBindingDictionary, plan } from '../../src/planning/planner'; -import { resolveInstance } from '../../src/resolution/instantiation'; -import { resolve } from '../../src/resolution/resolver'; +import { inject } from '../../annotation/inject'; +import { injectable } from '../../annotation/injectable'; +import { multiInject } from '../../annotation/multi_inject'; +import { named } from '../../annotation/named'; +import { postConstruct } from '../../annotation/post_construct'; +import { preDestroy } from '../../annotation/pre_destroy'; +import { tagged } from '../../annotation/tagged'; +import { targetName } from '../../annotation/target_name'; +import * as ERROR_MSGS from '../../constants/error_msgs'; +import { BindingTypeEnum, TargetTypeEnum } from '../../constants/literal_types'; +import { Container } from '../../container/container'; +import type { interfaces } from '../../interfaces/interfaces'; +import { MetadataReader } from '../../planning/metadata_reader'; +import { getBindingDictionary, plan } from '../../planning/planner'; +import { resolveInstance } from '../../resolution/instantiation'; +import { resolve } from '../../resolution/resolver'; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters function resolveTyped(context: interfaces.Context): T { diff --git a/test/syntax/binding_in_syntax.test.ts b/src/test/syntax/binding_in_syntax.test.ts similarity index 87% rename from test/syntax/binding_in_syntax.test.ts rename to src/test/syntax/binding_in_syntax.test.ts index 9c7e9403b..19ca13605 100644 --- a/test/syntax/binding_in_syntax.test.ts +++ b/src/test/syntax/binding_in_syntax.test.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { Binding } from '../../src/bindings/binding'; -import { BindingScopeEnum } from '../../src/constants/literal_types'; -import { BindingInSyntax } from '../../src/syntax/binding_in_syntax'; +import { Binding } from '../../bindings/binding'; +import { BindingScopeEnum } from '../../constants/literal_types'; +import { BindingInSyntax } from '../../syntax/binding_in_syntax'; describe('BindingInSyntax', () => { it('Should set its own properties correctly', () => { diff --git a/test/syntax/binding_in_when_on_syntax.test.ts b/src/test/syntax/binding_in_when_on_syntax.test.ts similarity index 96% rename from test/syntax/binding_in_when_on_syntax.test.ts rename to src/test/syntax/binding_in_when_on_syntax.test.ts index 79431eb4c..9c4bcb87d 100644 --- a/test/syntax/binding_in_when_on_syntax.test.ts +++ b/src/test/syntax/binding_in_when_on_syntax.test.ts @@ -1,11 +1,11 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { injectable } from '../../src/annotation/injectable'; -import { Binding } from '../../src/bindings/binding'; -import { BindingScopeEnum } from '../../src/constants/literal_types'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { BindingInWhenOnSyntax } from '../../src/syntax/binding_in_when_on_syntax'; +import { injectable } from '../../annotation/injectable'; +import { Binding } from '../../bindings/binding'; +import { BindingScopeEnum } from '../../constants/literal_types'; +import type { interfaces } from '../../interfaces/interfaces'; +import { BindingInWhenOnSyntax } from '../../syntax/binding_in_when_on_syntax'; describe('BindingInWhenOnSyntax', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/syntax/binding_on_syntax.test.ts b/src/test/syntax/binding_on_syntax.test.ts similarity index 82% rename from test/syntax/binding_on_syntax.test.ts rename to src/test/syntax/binding_on_syntax.test.ts index 7c49d8c64..617dbbb01 100644 --- a/test/syntax/binding_on_syntax.test.ts +++ b/src/test/syntax/binding_on_syntax.test.ts @@ -1,9 +1,9 @@ import { expect } from 'chai'; -import { Binding } from '../../src/bindings/binding'; -import { BindingScopeEnum } from '../../src/constants/literal_types'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { BindingOnSyntax } from '../../src/syntax/binding_on_syntax'; +import { Binding } from '../../bindings/binding'; +import { BindingScopeEnum } from '../../constants/literal_types'; +import type { interfaces } from '../../interfaces/interfaces'; +import { BindingOnSyntax } from '../../syntax/binding_on_syntax'; describe('BindingOnSyntax', () => { it('Should set its own properties correctly', () => { diff --git a/test/syntax/binding_to_syntax.test.ts b/src/test/syntax/binding_to_syntax.test.ts similarity index 92% rename from test/syntax/binding_to_syntax.test.ts rename to src/test/syntax/binding_to_syntax.test.ts index 36b9a8a43..2f7a02165 100644 --- a/test/syntax/binding_to_syntax.test.ts +++ b/src/test/syntax/binding_to_syntax.test.ts @@ -2,15 +2,15 @@ import { expect } from 'chai'; import sinon from 'sinon'; import Sinon from 'sinon'; -import { injectable } from '../../src/annotation/injectable'; -import { Binding } from '../../src/bindings/binding'; -import * as ERROR_MSGS from '../../src/constants/error_msgs'; +import { injectable } from '../../annotation/injectable'; +import { Binding } from '../../bindings/binding'; +import * as ERROR_MSGS from '../../constants/error_msgs'; import { BindingScopeEnum, BindingTypeEnum, -} from '../../src/constants/literal_types'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { BindingToSyntax } from '../../src/syntax/binding_to_syntax'; +} from '../../constants/literal_types'; +import type { interfaces } from '../../interfaces/interfaces'; +import { BindingToSyntax } from '../../syntax/binding_to_syntax'; describe('BindingToSyntax', () => { it('Should set its own properties correctly', () => { diff --git a/test/syntax/binding_when_on_syntax.test.ts b/src/test/syntax/binding_when_on_syntax.test.ts similarity index 95% rename from test/syntax/binding_when_on_syntax.test.ts rename to src/test/syntax/binding_when_on_syntax.test.ts index 6ba203f89..b6d201fd8 100644 --- a/test/syntax/binding_when_on_syntax.test.ts +++ b/src/test/syntax/binding_when_on_syntax.test.ts @@ -1,11 +1,11 @@ import { expect } from 'chai'; import Sinon, * as sinon from 'sinon'; -import { injectable } from '../../src/annotation/injectable'; -import { Binding } from '../../src/bindings/binding'; -import { BindingScopeEnum } from '../../src/constants/literal_types'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { BindingWhenOnSyntax } from '../../src/syntax/binding_when_on_syntax'; +import { injectable } from '../../annotation/injectable'; +import { Binding } from '../../bindings/binding'; +import { BindingScopeEnum } from '../../constants/literal_types'; +import type { interfaces } from '../../interfaces/interfaces'; +import { BindingWhenOnSyntax } from '../../syntax/binding_when_on_syntax'; describe('BindingWhenOnSyntax', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/syntax/binding_when_syntax.test.ts b/src/test/syntax/binding_when_syntax.test.ts similarity index 98% rename from test/syntax/binding_when_syntax.test.ts rename to src/test/syntax/binding_when_syntax.test.ts index fd4f76299..bacbf7789 100644 --- a/test/syntax/binding_when_syntax.test.ts +++ b/src/test/syntax/binding_when_syntax.test.ts @@ -4,17 +4,17 @@ import { } from '@inversifyjs/core'; import { expect } from 'chai'; -import { Binding } from '../../src/bindings/binding'; +import { Binding } from '../../bindings/binding'; import { BindingScopeEnum, TargetTypeEnum, -} from '../../src/constants/literal_types'; -import { Container } from '../../src/container/container'; -import type { interfaces } from '../../src/interfaces/interfaces'; -import { Context } from '../../src/planning/context'; -import { Request } from '../../src/planning/request'; -import { BindingWhenSyntax } from '../../src/syntax/binding_when_syntax'; -import { typeConstraint } from '../../src/syntax/constraint_helpers'; +} from '../../constants/literal_types'; +import { Container } from '../../container/container'; +import type { interfaces } from '../../interfaces/interfaces'; +import { Context } from '../../planning/context'; +import { Request } from '../../planning/request'; +import { BindingWhenSyntax } from '../../syntax/binding_when_syntax'; +import { typeConstraint } from '../../syntax/constraint_helpers'; describe('BindingWhenSyntax', () => { it('Should set its own properties correctly', () => { diff --git a/test/syntax/constraint_helpers.test.ts b/src/test/syntax/constraint_helpers.test.ts similarity index 77% rename from test/syntax/constraint_helpers.test.ts rename to src/test/syntax/constraint_helpers.test.ts index 1d42e1dcb..5b0ada183 100644 --- a/test/syntax/constraint_helpers.test.ts +++ b/src/test/syntax/constraint_helpers.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { typeConstraint } from '../../src/syntax/constraint_helpers'; +import { typeConstraint } from '../../syntax/constraint_helpers'; describe('BindingInSyntax', () => { it('Should be return false when a request object is not provided', () => { diff --git a/test/utils/binding_utils.test.ts b/src/test/utils/binding_utils.test.ts similarity index 74% rename from test/utils/binding_utils.test.ts rename to src/test/utils/binding_utils.test.ts index cca40ee1c..1ca7c09b1 100644 --- a/test/utils/binding_utils.test.ts +++ b/src/test/utils/binding_utils.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { Binding } from '../../src/bindings/binding'; -import { getFactoryDetails } from '../../src/utils/binding_utils'; +import { Binding } from '../../bindings/binding'; +import { getFactoryDetails } from '../../utils/binding_utils'; describe('getFactoryDetails', () => { it('should thrown an exception non factory binding.type', () => { diff --git a/test/utils/id.test.ts b/src/test/utils/id.test.ts similarity index 81% rename from test/utils/id.test.ts rename to src/test/utils/id.test.ts index f1671b132..2042992dc 100644 --- a/test/utils/id.test.ts +++ b/src/test/utils/id.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { id } from '../../src/utils/id'; +import { id } from '../../utils/id'; describe('ID', () => { it('Should be able to generate an id', () => { diff --git a/test/utils/serialization.test.ts b/src/test/utils/serialization.test.ts similarity index 93% rename from test/utils/serialization.test.ts rename to src/test/utils/serialization.test.ts index 3ca4d1d2d..feb269834 100644 --- a/test/utils/serialization.test.ts +++ b/src/test/utils/serialization.test.ts @@ -4,12 +4,12 @@ import { } from '@inversifyjs/core'; import { expect } from 'chai'; -import { TargetTypeEnum } from '../../src/constants/literal_types'; +import { TargetTypeEnum } from '../../constants/literal_types'; import { getFunctionName, getSymbolDescription, listMetadataForTarget, -} from '../../src/utils/serialization'; +} from '../../utils/serialization'; describe('Serialization', () => { it('Should return a good function name', () => { diff --git a/test/utils/stubs.ts b/src/test/utils/stubs.ts similarity index 96% rename from test/utils/stubs.ts rename to src/test/utils/stubs.ts index 366940b34..d93e5ae1e 100644 --- a/test/utils/stubs.ts +++ b/src/test/utils/stubs.ts @@ -1,4 +1,4 @@ -import { inject, injectable, named, tagged } from '../../src/index'; +import { inject, injectable, named, tagged } from '../../index'; export interface FooInterface { name: string;