diff --git a/fixtures/no-runner/basic-logs.test.ts b/fixtures/no-runner/basic-logs.test.ts index 065004c0..aeb988ac 100644 --- a/fixtures/no-runner/basic-logs.test.ts +++ b/fixtures/no-runner/basic-logs.test.ts @@ -1,7 +1,7 @@ import { assert } from '../../src/modules/essentials/assert.js'; import { test } from '../../src/modules/helpers/test.js'; import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; assert(true, 'Should emit a basic assetion log'); diff --git a/src/modules/helpers/it.ts b/src/modules/helpers/it/core.ts similarity index 80% rename from src/modules/helpers/it.ts rename to src/modules/helpers/it/core.ts index 12ccf787..7c133b75 100644 --- a/src/modules/helpers/it.ts +++ b/src/modules/helpers/it/core.ts @@ -1,17 +1,17 @@ import { hrtime, env } from 'node:process'; -import { each } from '../../configs/each.js'; -import { indentation } from '../../configs/indentation.js'; -import { format } from '../../services/format.js'; -import { Write } from '../../services/write.js'; +import { each } from '../../../configs/each.js'; +import { indentation } from '../../../configs/indentation.js'; +import { format } from '../../../services/format.js'; +import { Write } from '../../../services/write.js'; -export async function it( +async function itCore( message: string, cb: () => Promise ): Promise; -export function it(message: string, cb: () => unknown): void; -export async function it(cb: () => Promise): Promise; -export function it(cb: () => unknown): void; -export async function it( +function itCore(message: string, cb: () => unknown): void; +async function itCore(cb: () => Promise): Promise; +function itCore(cb: () => unknown): void; +async function itCore( ...args: [ string | (() => unknown | Promise), (() => unknown | Promise)?, @@ -88,3 +88,5 @@ export async function it( throw error; } } + +export const it = Object.assign(itCore, {}); diff --git a/src/modules/helpers/test.ts b/src/modules/helpers/test.ts index 109afba4..b7fe8e35 100644 --- a/src/modules/helpers/test.ts +++ b/src/modules/helpers/test.ts @@ -1,3 +1,3 @@ -import { it } from './it.js'; +import { it } from './it/core.js'; export const test = it; diff --git a/src/modules/index.ts b/src/modules/index.ts index 22822146..dba3213e 100755 --- a/src/modules/index.ts +++ b/src/modules/index.ts @@ -5,7 +5,7 @@ export { assert } from './essentials/assert.js'; export { strict } from './essentials/strict.js'; export { test } from './helpers/test.js'; export { describe } from './helpers/describe.js'; -export { it } from './helpers/it.js'; +export { it } from './helpers/it/core.js'; export { envFile } from './helpers/env.js'; export { skip } from './helpers/skip.js'; export { beforeEach, afterEach } from './helpers/each.js'; diff --git a/test/e2e/background-process.test.ts b/test/e2e/background-process.test.ts index a31bd85f..1326188e 100644 --- a/test/e2e/background-process.test.ts +++ b/test/e2e/background-process.test.ts @@ -1,6 +1,6 @@ import { test } from '../../src/modules/helpers/test.js'; import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { startScript, diff --git a/test/e2e/basic-logs.test.ts b/test/e2e/basic-logs.test.ts index e788d74e..9dd68d56 100644 --- a/test/e2e/basic-logs.test.ts +++ b/test/e2e/basic-logs.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { inspectCLI, isProduction } from '../helpers/capture-cli.test.js'; import { skip } from '../../src/modules/helpers/skip.js'; diff --git a/test/e2e/before-and-after-each.test.ts b/test/e2e/before-and-after-each.test.ts index c13b7539..824a2ec0 100644 --- a/test/e2e/before-and-after-each.test.ts +++ b/test/e2e/before-and-after-each.test.ts @@ -1,6 +1,6 @@ import { test } from '../../src/modules/helpers/test.js'; import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { poku } from '../../src/modules/essentials/poku.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { isProduction } from '../helpers/capture-cli.test.js'; diff --git a/test/e2e/config-files.test.ts b/test/e2e/config-files.test.ts index 784ca81c..46947429 100644 --- a/test/e2e/config-files.test.ts +++ b/test/e2e/config-files.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { inspectCLI, isProduction } from '../helpers/capture-cli.test.js'; import { skip } from '../../src/modules/helpers/skip.js'; diff --git a/test/e2e/each-api/failure.test.ts b/test/e2e/each-api/failure.test.ts index 07a87da8..06d633a3 100644 --- a/test/e2e/each-api/failure.test.ts +++ b/test/e2e/each-api/failure.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { assert } from '../../../src/modules/essentials/assert.js'; import { inspectCLI, isProduction } from '../../helpers/capture-cli.test.js'; import { skip } from '../../../src/modules/helpers/skip.js'; diff --git a/test/e2e/each-api/order.test.ts b/test/e2e/each-api/order.test.ts index a91924bf..5cdc2b87 100644 --- a/test/e2e/each-api/order.test.ts +++ b/test/e2e/each-api/order.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { assert } from '../../../src/modules/essentials/assert.js'; import { inspectCLI, isProduction } from '../../helpers/capture-cli.test.js'; import { skip } from '../../../src/modules/helpers/skip.js'; diff --git a/test/e2e/exit-code.test.ts b/test/e2e/exit-code.test.ts index 3f2633dd..4611a44b 100644 --- a/test/e2e/exit-code.test.ts +++ b/test/e2e/exit-code.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { poku } from '../../src/modules/essentials/poku.js'; import { assert } from '../../src/modules/essentials/assert.js'; diff --git a/test/e2e/fail-fast.test.ts b/test/e2e/fail-fast.test.ts index 6257e243..c067f229 100644 --- a/test/e2e/fail-fast.test.ts +++ b/test/e2e/fail-fast.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { inspectCLI, isProduction } from '../helpers/capture-cli.test.js'; import { skip } from '../../src/modules/helpers/skip.js'; diff --git a/test/e2e/failure.test.ts b/test/e2e/failure.test.ts index 371c09a4..c7ea3278 100644 --- a/test/e2e/failure.test.ts +++ b/test/e2e/failure.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { inspectCLI, isProduction } from '../helpers/capture-cli.test.js'; import { skip } from '../../src/modules/helpers/skip.js'; diff --git a/test/e2e/runners.test.ts b/test/e2e/runners.test.ts index c18f19cf..947d3707 100644 --- a/test/e2e/runners.test.ts +++ b/test/e2e/runners.test.ts @@ -1,6 +1,6 @@ import { execSync } from 'node:child_process'; import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { isProduction, inspectCLI } from '../helpers/capture-cli.test.js'; import { skip } from '../../src/modules/helpers/skip.js'; diff --git a/test/e2e/watch.test.ts b/test/e2e/watch.test.ts index 6b2fa2b7..0a51613a 100644 --- a/test/e2e/watch.test.ts +++ b/test/e2e/watch.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { watchCLI } from '../helpers/capture-cli.test.js'; import { skip } from '../../src/modules/helpers/skip.js'; diff --git a/test/integration/assert/assert-no-message.test.ts b/test/integration/assert/assert-no-message.test.ts index 1342afca..ae5a93a1 100644 --- a/test/integration/assert/assert-no-message.test.ts +++ b/test/integration/assert/assert-no-message.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { assert } from '../../../src/modules/essentials/assert.js'; import { nodeVersion } from '../../../src/parsers/get-runtime.js'; diff --git a/test/integration/assert/assert.test.ts b/test/integration/assert/assert.test.ts index 673346a1..7ce61784 100644 --- a/test/integration/assert/assert.test.ts +++ b/test/integration/assert/assert.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { assert } from '../../../src/modules/essentials/assert.js'; import { nodeVersion } from '../../../src/parsers/get-runtime.js'; diff --git a/test/integration/containers/test-docker-compose.test.ts b/test/integration/containers/test-docker-compose.test.ts index 2ef2b786..e1d45e03 100644 --- a/test/integration/containers/test-docker-compose.test.ts +++ b/test/integration/containers/test-docker-compose.test.ts @@ -1,6 +1,6 @@ import { execSync } from 'node:child_process'; import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { assert } from '../../../src/modules/essentials/assert.js'; import { docker } from '../../../src/modules/helpers/container.js'; import { legacyFetch } from '../../helpers/legacy-fetch.test.js'; diff --git a/test/integration/containers/test-dockerfile.test.ts b/test/integration/containers/test-dockerfile.test.ts index 1c31ee3b..44848eae 100644 --- a/test/integration/containers/test-dockerfile.test.ts +++ b/test/integration/containers/test-dockerfile.test.ts @@ -1,6 +1,6 @@ import { execSync } from 'node:child_process'; import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { assert } from '../../../src/modules/essentials/assert.js'; import { docker } from '../../../src/modules/helpers/container.js'; import { waitForPort } from '../../../src/modules/helpers/wait-for.js'; diff --git a/test/integration/it/each/each-options-promise.test.ts b/test/integration/it/each/each-options-promise.test.ts index 910e3ba5..cc3f1df9 100644 --- a/test/integration/it/each/each-options-promise.test.ts +++ b/test/integration/it/each/each-options-promise.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../../../src/modules/helpers/describe.js'; -import { it } from '../../../../src/modules/helpers/it.js'; +import { it } from '../../../../src/modules/helpers/it/core.js'; import { assert } from '../../../../src/modules/essentials/assert.js'; import { beforeEach, afterEach } from '../../../../src/modules/helpers/each.js'; diff --git a/test/integration/it/each/each-options.test.ts b/test/integration/it/each/each-options.test.ts index 90fca090..91a7bd9c 100644 --- a/test/integration/it/each/each-options.test.ts +++ b/test/integration/it/each/each-options.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../../../src/modules/helpers/describe.js'; -import { it } from '../../../../src/modules/helpers/it.js'; +import { it } from '../../../../src/modules/helpers/it/core.js'; import { assert } from '../../../../src/modules/essentials/assert.js'; import { beforeEach, afterEach } from '../../../../src/modules/helpers/each.js'; diff --git a/test/integration/it/it.test.ts b/test/integration/it/it.test.ts index 1f0d025d..a650804a 100644 --- a/test/integration/it/it.test.ts +++ b/test/integration/it/it.test.ts @@ -1,6 +1,6 @@ import { test } from '../../../src/modules/helpers/test.js'; import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; test('Testing "it" method', () => { describe(async () => { diff --git a/test/integration/strict/assert-no-message.test.ts b/test/integration/strict/assert-no-message.test.ts index 93ea8b44..ee178b9f 100644 --- a/test/integration/strict/assert-no-message.test.ts +++ b/test/integration/strict/assert-no-message.test.ts @@ -6,7 +6,7 @@ if (nodeVersion && nodeVersion < 16) { } import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { strict as assert } from '../../../src/modules/essentials/strict.js'; describe('Strict Suite (No Message)', () => { diff --git a/test/integration/strict/assert.test.ts b/test/integration/strict/assert.test.ts index 6d7f9c83..2923f7ae 100644 --- a/test/integration/strict/assert.test.ts +++ b/test/integration/strict/assert.test.ts @@ -6,7 +6,7 @@ if (nodeVersion && nodeVersion < 16) { } import { describe } from '../../../src/modules/helpers/describe.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { strict as assert } from '../../../src/modules/essentials/strict.js'; describe('Strict Suite', async () => { diff --git a/test/integration/wait-for/wait-for-port.test.ts b/test/integration/wait-for/wait-for-port.test.ts index 3c086475..36696e72 100644 --- a/test/integration/wait-for/wait-for-port.test.ts +++ b/test/integration/wait-for/wait-for-port.test.ts @@ -1,6 +1,6 @@ import { createServer, type Server } from 'node:http'; import { test } from '../../../src/modules/helpers/test.js'; -import { it } from '../../../src/modules/helpers/it.js'; +import { it } from '../../../src/modules/helpers/it/core.js'; import { assert } from '../../../src/modules/essentials/assert.js'; import { waitForPort } from '../../../src/modules/helpers/wait-for.js'; import { kill } from '../../../src/modules/helpers/kill.js'; diff --git a/test/unit/args.test.ts b/test/unit/args.test.ts index 81144592..d74cdaed 100644 --- a/test/unit/args.test.ts +++ b/test/unit/args.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { getArg, diff --git a/test/unit/env-services.test.ts b/test/unit/env-services.test.ts index 1cbb0a93..2781a59a 100644 --- a/test/unit/env-services.test.ts +++ b/test/unit/env-services.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { removeComments, diff --git a/test/unit/logs.test.ts b/test/unit/logs.test.ts index 4703ded3..582280c1 100644 --- a/test/unit/logs.test.ts +++ b/test/unit/logs.test.ts @@ -1,6 +1,6 @@ import process from 'node:process'; import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { isQuiet, isDebug, parserOutput } from '../../src/parsers/output.js'; import { Write } from '../../src/services/write.js'; diff --git a/test/unit/map-tests.test.ts b/test/unit/map-tests.test.ts index d55cee78..870df417 100644 --- a/test/unit/map-tests.test.ts +++ b/test/unit/map-tests.test.ts @@ -9,7 +9,7 @@ import { join } from 'node:path'; import { writeFileSync, mkdirSync, rmSync } from 'node:fs'; import { test } from '../../src/modules/helpers/test.js'; import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { beforeEach, afterEach } from '../../src/modules/helpers/each.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { diff --git a/test/unit/run-test-file.test.ts b/test/unit/run-test-file.test.ts index a1216b47..148e06fa 100644 --- a/test/unit/run-test-file.test.ts +++ b/test/unit/run-test-file.test.ts @@ -1,6 +1,6 @@ import process from 'node:process'; import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { runTestFile } from '../../src/services/run-test-file.js'; import { getRuntime } from '../../src/parsers/get-runtime.js'; diff --git a/test/unit/run-tests.test.ts b/test/unit/run-tests.test.ts index ce84911a..257529b3 100644 --- a/test/unit/run-tests.test.ts +++ b/test/unit/run-tests.test.ts @@ -1,5 +1,5 @@ import { describe } from '../../src/modules/helpers/describe.js'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { runTests } from '../../src/services/run-tests.js'; diff --git a/test/unit/watch.test.ts b/test/unit/watch.test.ts index 384313ce..4a99166a 100644 --- a/test/unit/watch.test.ts +++ b/test/unit/watch.test.ts @@ -1,6 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; -import { it } from '../../src/modules/helpers/it.js'; +import { it } from '../../src/modules/helpers/it/core.js'; import { describe } from '../../src/modules/helpers/describe.js'; import { beforeEach, afterEach } from '../../src/modules/helpers/each.js'; import { assert } from '../../src/modules/essentials/assert.js';