diff --git a/src/createContainer/__tests__/feature.deps.spec-d.ts b/src/createContainer/__tests__/container.deps.spec-d.ts similarity index 100% rename from src/createContainer/__tests__/feature.deps.spec-d.ts rename to src/createContainer/__tests__/container.deps.spec-d.ts diff --git a/src/createContainer/__tests__/feature.id.spec-d.ts b/src/createContainer/__tests__/container.id.spec-d.ts similarity index 70% rename from src/createContainer/__tests__/feature.id.spec-d.ts rename to src/createContainer/__tests__/container.id.spec-d.ts index 936eb2e..9e137a8 100644 --- a/src/createContainer/__tests__/feature.id.spec-d.ts +++ b/src/createContainer/__tests__/container.id.spec-d.ts @@ -1,6 +1,6 @@ import { createContainer } from '../index'; -describe('feature.id not empty string', () => { +describe('container.id not empty string', () => { test('happy', () => { createContainer({ id: 'a', @@ -10,7 +10,7 @@ describe('feature.id not empty string', () => { test('unhappy', () => { createContainer({ - // @ts-expect-error feature id cannot be an empty string + // @ts-expect-error container.id cannot be an empty string id: '', onStart: () => ({ api: {} }), }); diff --git a/src/createContainer/__tests__/feature.id.spec.ts b/src/createContainer/__tests__/container.id.spec.ts similarity index 84% rename from src/createContainer/__tests__/feature.id.spec.ts rename to src/createContainer/__tests__/container.id.spec.ts index 34acadf..809249a 100644 --- a/src/createContainer/__tests__/feature.id.spec.ts +++ b/src/createContainer/__tests__/container.id.spec.ts @@ -2,7 +2,7 @@ import { createContainer, IDS_SET } from '../index'; const onStart = () => ({ api: {} }); -describe('feature.id not empty string', () => { +describe('container.id not empty string', () => { beforeEach(() => IDS_SET.clear()); test('happy', () => { @@ -12,7 +12,7 @@ describe('feature.id not empty string', () => { test('unhappy', () => { expect(() => createContainer({ - // @ts-expect-error feature id cannot be an empty string + // @ts-expect-error container.id cannot be an empty string id: '', onStart: () => ({ api: {} }), }), @@ -20,7 +20,7 @@ describe('feature.id not empty string', () => { }); }); -describe('feature.id is uniq', () => { +describe('container.id is uniq', () => { beforeEach(() => IDS_SET.clear()); test('happy', () => { diff --git a/src/createContainer/index.ts b/src/createContainer/index.ts index a630150..ab607a3 100644 --- a/src/createContainer/index.ts +++ b/src/createContainer/index.ts @@ -18,7 +18,7 @@ type ExtractDeps[]> = { }; const ERROR = { - EMPTY_STRING_FEATURE_ID: 'Container ID cannot be an empty string.', + EMPTY_STRING_CONTAINER_ID: 'Container ID cannot be an empty string.', CONTAINER_ID_NOT_UNIQ: 'Container ID must be unique.', } as const; @@ -32,7 +32,7 @@ type Params< Deps extends NonEmptyTuple | void = void, OptionalDeps extends NonEmptyTuple | void = void, > = '' extends Id - ? { id: never; error: typeof ERROR.EMPTY_STRING_FEATURE_ID } + ? { id: never; error: typeof ERROR.EMPTY_STRING_CONTAINER_ID } : Deps extends void ? OptionalDeps extends void ? { @@ -81,7 +81,7 @@ const createContainer = < params: Params, ): Container => { if (params.id === '') { - throw new Error(ERROR.EMPTY_STRING_FEATURE_ID); + throw new Error(ERROR.EMPTY_STRING_CONTAINER_ID); } if (IDS_SET.has(params.id)) {