From a294cad3897030abd50e054b0d5611e1657f28c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Fri, 23 Jun 2023 11:24:35 -0300 Subject: [PATCH 1/4] chore(name): change folder name to annotations --- src/{decorators => annotations}/AfterAll.ts | 6 ++-- src/{decorators => annotations}/AfterEach.ts | 6 ++-- src/{decorators => annotations}/BeforeAll.ts | 6 ++-- src/{decorators => annotations}/BeforeEach.ts | 6 ++-- src/{decorators => annotations}/Cleanup.ts | 6 ++-- .../DisableTimeout.ts | 6 ++-- src/{decorators => annotations}/Fails.ts | 6 ++-- src/{decorators => annotations}/Pin.ts | 6 ++-- src/{decorators => annotations}/Retry.ts | 6 ++-- src/{decorators => annotations}/Setup.ts | 6 ++-- src/{decorators => annotations}/Skip.ts | 6 ++-- src/{decorators => annotations}/Tags.ts | 6 ++-- src/{decorators => annotations}/Teardown.ts | 6 ++-- src/{decorators => annotations}/Test.ts | 6 ++-- src/{decorators => annotations}/TestCase.ts | 6 ++-- src/{decorators => annotations}/Timeout.ts | 6 ++-- .../WaitForDone.ts | 6 ++-- src/converters/TestConverter.ts | 2 +- src/helpers/{Decorator.ts => Annotation.ts} | 4 +-- src/index.ts | 34 +++++++++---------- .../unit/decorators/AfterAllDecoratorTest.ts | 4 +-- .../unit/decorators/AfterEachDecoratorTest.ts | 4 +-- .../unit/decorators/BeforeAllDecoratorTest.ts | 4 +-- .../decorators/BeforeEachDecoratorTest.ts | 4 +-- tests/unit/decorators/CleanupDecoratorTest.ts | 6 ++-- .../decorators/DisableTimeoutDecoratorTest.ts | 6 ++-- tests/unit/decorators/FailsDecoratorTest.ts | 6 ++-- tests/unit/decorators/PinDecoratorTest.ts | 6 ++-- tests/unit/decorators/RetryDecoratorTest.ts | 6 ++-- tests/unit/decorators/SetupDecoratorTest.ts | 6 ++-- tests/unit/decorators/SkipDecoratorTest.ts | 6 ++-- tests/unit/decorators/TagsDecoratorTest.ts | 6 ++-- .../unit/decorators/TeardownDecoratorTest.ts | 6 ++-- .../unit/decorators/TestCaseDecoratorTest.ts | 6 ++-- tests/unit/decorators/TestDecoratorTest.ts | 4 +-- tests/unit/decorators/TimeoutDecoratorTest.ts | 6 ++-- .../decorators/WaitForDoneDecoratorTest.ts | 6 ++-- 37 files changed, 117 insertions(+), 117 deletions(-) rename src/{decorators => annotations}/AfterAll.ts (79%) rename src/{decorators => annotations}/AfterEach.ts (79%) rename src/{decorators => annotations}/BeforeAll.ts (79%) rename src/{decorators => annotations}/BeforeEach.ts (79%) rename src/{decorators => annotations}/Cleanup.ts (85%) rename src/{decorators => annotations}/DisableTimeout.ts (79%) rename src/{decorators => annotations}/Fails.ts (80%) rename src/{decorators => annotations}/Pin.ts (80%) rename src/{decorators => annotations}/Retry.ts (78%) rename src/{decorators => annotations}/Setup.ts (77%) rename src/{decorators => annotations}/Skip.ts (77%) rename src/{decorators => annotations}/Tags.ts (78%) rename src/{decorators => annotations}/Teardown.ts (85%) rename src/{decorators => annotations}/Test.ts (77%) rename src/{decorators => annotations}/TestCase.ts (81%) rename src/{decorators => annotations}/Timeout.ts (76%) rename src/{decorators => annotations}/WaitForDone.ts (78%) rename src/helpers/{Decorator.ts => Annotation.ts} (91%) diff --git a/src/decorators/AfterAll.ts b/src/annotations/AfterAll.ts similarity index 79% rename from src/decorators/AfterAll.ts rename to src/annotations/AfterAll.ts index be481c3..74a9848 100644 --- a/src/decorators/AfterAll.ts +++ b/src/annotations/AfterAll.ts @@ -9,16 +9,16 @@ import 'reflect-metadata' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Create a new after all (teardown) hook. */ -export function AfterAll(): MethodDecorator { +export function AfterAll(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const afterAllHooks = Reflect.getMetadata('hooks:afterAll', Target) diff --git a/src/decorators/AfterEach.ts b/src/annotations/AfterEach.ts similarity index 79% rename from src/decorators/AfterEach.ts rename to src/annotations/AfterEach.ts index b89e4bb..c63ae74 100644 --- a/src/decorators/AfterEach.ts +++ b/src/annotations/AfterEach.ts @@ -9,16 +9,16 @@ import 'reflect-metadata' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Create a new after each (teardown.each) hook. */ -export function AfterEach(): MethodDecorator { +export function AfterEach(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const afterEachHooks = Reflect.getMetadata('hooks:afterEach', Target) diff --git a/src/decorators/BeforeAll.ts b/src/annotations/BeforeAll.ts similarity index 79% rename from src/decorators/BeforeAll.ts rename to src/annotations/BeforeAll.ts index cce93bf..f4fb849 100644 --- a/src/decorators/BeforeAll.ts +++ b/src/annotations/BeforeAll.ts @@ -9,16 +9,16 @@ import 'reflect-metadata' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Create a new before all (setup) hook. */ -export function BeforeAll(): MethodDecorator { +export function BeforeAll(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const beforeAllHooks = Reflect.getMetadata('hooks:beforeAll', Target) diff --git a/src/decorators/BeforeEach.ts b/src/annotations/BeforeEach.ts similarity index 79% rename from src/decorators/BeforeEach.ts rename to src/annotations/BeforeEach.ts index 97b8c34..fe59ea2 100644 --- a/src/decorators/BeforeEach.ts +++ b/src/annotations/BeforeEach.ts @@ -9,16 +9,16 @@ import 'reflect-metadata' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Create a new before each (setup.each) hook. */ -export function BeforeEach(): MethodDecorator { +export function BeforeEach(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const beforeEachHooks = Reflect.getMetadata('hooks:beforeEach', Target) diff --git a/src/decorators/Cleanup.ts b/src/annotations/Cleanup.ts similarity index 85% rename from src/decorators/Cleanup.ts rename to src/annotations/Cleanup.ts index e7e3a8f..5399932 100644 --- a/src/decorators/Cleanup.ts +++ b/src/annotations/Cleanup.ts @@ -11,16 +11,16 @@ import 'reflect-metadata' import type { Context, CleanupHandler } from '#src/types' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Register a cleanup hook from within the test. */ -export function Cleanup(handler: CleanupHandler): MethodDecorator { +export function Cleanup(handler: CleanupHandler): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/DisableTimeout.ts b/src/annotations/DisableTimeout.ts similarity index 79% rename from src/decorators/DisableTimeout.ts rename to src/annotations/DisableTimeout.ts index 83e8736..e32c5b4 100644 --- a/src/decorators/DisableTimeout.ts +++ b/src/annotations/DisableTimeout.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Disable test timeout. It is the same as calling `test.timeout(0)` */ -export function DisableTimeout(): MethodDecorator { +export function DisableTimeout(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Fails.ts b/src/annotations/Fails.ts similarity index 80% rename from src/decorators/Fails.ts rename to src/annotations/Fails.ts index be3c4a6..aa9e6e4 100644 --- a/src/decorators/Fails.ts +++ b/src/annotations/Fails.ts @@ -10,17 +10,17 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Expect the test to fail. Helpful in creating test cases to * showcase bugs. */ -export function Fails(): MethodDecorator { +export function Fails(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Pin.ts b/src/annotations/Pin.ts similarity index 80% rename from src/decorators/Pin.ts rename to src/annotations/Pin.ts index dbbffd7..a8d3f62 100644 --- a/src/decorators/Pin.ts +++ b/src/annotations/Pin.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Pin the test. If one test is pinned, Japa will run only pinned tests. */ -export function Pin(): MethodDecorator { +export function Pin(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Retry.ts b/src/annotations/Retry.ts similarity index 78% rename from src/decorators/Retry.ts rename to src/annotations/Retry.ts index a1da67b..634d693 100644 --- a/src/decorators/Retry.ts +++ b/src/annotations/Retry.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Configure the number of times this test should be retried when failing. */ -export function Retry(times: number): MethodDecorator { +export function Retry(times: number): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Setup.ts b/src/annotations/Setup.ts similarity index 77% rename from src/decorators/Setup.ts rename to src/annotations/Setup.ts index 3392be9..c17f8be 100644 --- a/src/decorators/Setup.ts +++ b/src/annotations/Setup.ts @@ -11,16 +11,16 @@ import 'reflect-metadata' import type { Context, SetupHandler } from '#src/types' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Register a setup hook from within the test. */ -export function Setup(handler: SetupHandler): MethodDecorator { +export function Setup(handler: SetupHandler): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Skip.ts b/src/annotations/Skip.ts similarity index 77% rename from src/decorators/Skip.ts rename to src/annotations/Skip.ts index 69c354b..c6b7a77 100644 --- a/src/decorators/Skip.ts +++ b/src/annotations/Skip.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Skip the test conditionally. */ -export function Skip(reason?: string): MethodDecorator { +export function Skip(reason?: string): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Tags.ts b/src/annotations/Tags.ts similarity index 78% rename from src/decorators/Tags.ts rename to src/annotations/Tags.ts index 896fbcb..25ee956 100644 --- a/src/decorators/Tags.ts +++ b/src/annotations/Tags.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Assign tags to the test. Later you can use the tags to run specific tests. */ -export function Tags(tags: string[]): MethodDecorator { +export function Tags(tags: string[]): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Teardown.ts b/src/annotations/Teardown.ts similarity index 85% rename from src/decorators/Teardown.ts rename to src/annotations/Teardown.ts index d0586b2..3e7a3d2 100644 --- a/src/decorators/Teardown.ts +++ b/src/annotations/Teardown.ts @@ -11,16 +11,16 @@ import 'reflect-metadata' import type { Context, TeardownHandler } from '#src/types' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Register a teardown hook from within the test. */ -export function Teardown(handler: TeardownHandler): MethodDecorator { +export function Teardown(handler: TeardownHandler): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/Test.ts b/src/annotations/Test.ts similarity index 77% rename from src/decorators/Test.ts rename to src/annotations/Test.ts index eaf7d1b..074b83d 100644 --- a/src/decorators/Test.ts +++ b/src/annotations/Test.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Create a new test. */ -export function Test(title?: string): MethodDecorator { +export function Test(title?: string): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/TestCase.ts b/src/annotations/TestCase.ts similarity index 81% rename from src/decorators/TestCase.ts rename to src/annotations/TestCase.ts index a64e457..e42bcc7 100644 --- a/src/decorators/TestCase.ts +++ b/src/annotations/TestCase.ts @@ -10,17 +10,17 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Define the dataset for the test case. The test executor will be invoked * for all the items inside the dataset array. */ -export function TestCase(value: any): MethodDecorator { +export function TestCase(value: any): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) const cases = tests.get(`${property}.with`, []) diff --git a/src/decorators/Timeout.ts b/src/annotations/Timeout.ts similarity index 76% rename from src/decorators/Timeout.ts rename to src/annotations/Timeout.ts index 1ba34cf..6846136 100644 --- a/src/decorators/Timeout.ts +++ b/src/annotations/Timeout.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Set the test timeout. */ -export function Timeout(timeout: number): MethodDecorator { +export function Timeout(timeout: number): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/decorators/WaitForDone.ts b/src/annotations/WaitForDone.ts similarity index 78% rename from src/decorators/WaitForDone.ts rename to src/annotations/WaitForDone.ts index 3a12eee..4b6182d 100644 --- a/src/decorators/WaitForDone.ts +++ b/src/annotations/WaitForDone.ts @@ -10,16 +10,16 @@ import 'reflect-metadata' import { ObjectBuilder } from '@athenna/common' -import { Decorator } from '#src/helpers/Decorator' +import { Annotation } from '#src/helpers/Annotation' /** * Wait for the test executor to call done method. */ -export function WaitForDone(): MethodDecorator { +export function WaitForDone(): MethodAnnotation { return (target: any, property: string, _: any) => { const Target = target.constructor - Decorator.defineDefaultMetadata(Target) + Annotation.defineDefaultMetadata(Target) const tests: ObjectBuilder = Reflect.getMetadata('tests', Target) diff --git a/src/converters/TestConverter.ts b/src/converters/TestConverter.ts index 2b156f9..391d974 100644 --- a/src/converters/TestConverter.ts +++ b/src/converters/TestConverter.ts @@ -13,7 +13,7 @@ import { test as japaTest } from '#src' export class TestConverter { /** - * Convert test options of decorators to Japa test options. + * Convert test options of annotation to Japa test options. */ public static async convert(closure: any, options: Options) { if (!closure) { diff --git a/src/helpers/Decorator.ts b/src/helpers/Annotation.ts similarity index 91% rename from src/helpers/Decorator.ts rename to src/helpers/Annotation.ts index 4340d37..9a9176f 100644 --- a/src/helpers/Decorator.ts +++ b/src/helpers/Annotation.ts @@ -9,11 +9,11 @@ import { ObjectBuilder } from '@athenna/common' -export class Decorator { +export class Annotation { /** * Define default metadata values in target. */ - public static defineDefaultMetadata(target: any): typeof Decorator { + public static defineDefaultMetadata(target: any): typeof Annotation { if (!Reflect.hasMetadata('tests', target)) { Reflect.defineMetadata( 'tests', diff --git a/src/index.ts b/src/index.ts index 5246cc3..29b790f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,20 +29,20 @@ export * from '#src/globals/Context' export * from '#src/helpers/Runner' export * from '#src/helpers/Importer' export * from '#src/helpers/ExitFaker' -export * from '#src/decorators/AfterAll' -export * from '#src/decorators/AfterEach' -export * from '#src/decorators/BeforeAll' -export * from '#src/decorators/BeforeEach' -export * from '#src/decorators/Cleanup' -export * from '#src/decorators/DisableTimeout' -export * from '#src/decorators/Fails' -export * from '#src/decorators/Pin' -export * from '#src/decorators/Retry' -export * from '#src/decorators/Setup' -export * from '#src/decorators/Skip' -export * from '#src/decorators/Tags' -export * from '#src/decorators/Teardown' -export * from '#src/decorators/Test' -export * from '#src/decorators/TestCase' -export * from '#src/decorators/Timeout' -export * from '#src/decorators/WaitForDone' +export * from '#src/annotations/AfterAll' +export * from '#src/annotations/AfterEach' +export * from '#src/annotations/BeforeAll' +export * from '#src/annotations/BeforeEach' +export * from '#src/annotations/Cleanup' +export * from '#src/annotations/DisableTimeout' +export * from '#src/annotations/Fails' +export * from '#src/annotations/Pin' +export * from '#src/annotations/Retry' +export * from '#src/annotations/Setup' +export * from '#src/annotations/Skip' +export * from '#src/annotations/Tags' +export * from '#src/annotations/Teardown' +export * from '#src/annotations/Test' +export * from '#src/annotations/TestCase' +export * from '#src/annotations/Timeout' +export * from '#src/annotations/WaitForDone' diff --git a/tests/unit/decorators/AfterAllDecoratorTest.ts b/tests/unit/decorators/AfterAllDecoratorTest.ts index 817500a..7a59e31 100644 --- a/tests/unit/decorators/AfterAllDecoratorTest.ts +++ b/tests/unit/decorators/AfterAllDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, AfterAll } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('AfterAllDecoratorTest', () => { - test('should be able to register after all hook of some class using after all decorator', async ({ assert }) => { +test.group('AfterAllAnnotationTest', () => { + test('should be able to register after all hook of some class using after all annotation', async ({ assert }) => { class MyClass { @AfterAll() public async afterAll() {} diff --git a/tests/unit/decorators/AfterEachDecoratorTest.ts b/tests/unit/decorators/AfterEachDecoratorTest.ts index b91f117..faa6511 100644 --- a/tests/unit/decorators/AfterEachDecoratorTest.ts +++ b/tests/unit/decorators/AfterEachDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, AfterEach } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('AfterEachDecoratorTest', () => { - test('should be able to register after each hook of some class using after each decorator', async ({ assert }) => { +test.group('AfterEachAnnotationTest', () => { + test('should be able to register after each hook of some class using after each annotation', async ({ assert }) => { class MyClass { @AfterEach() public async afterEach() {} diff --git a/tests/unit/decorators/BeforeAllDecoratorTest.ts b/tests/unit/decorators/BeforeAllDecoratorTest.ts index 2e9c4b2..1f94e2f 100644 --- a/tests/unit/decorators/BeforeAllDecoratorTest.ts +++ b/tests/unit/decorators/BeforeAllDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, BeforeAll } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('BeforeAllDecoratorTest', () => { - test('should be able to register before all hook of some class using before all decorator', async ({ assert }) => { +test.group('BeforeAllAnnotationTest', () => { + test('should be able to register before all hook of some class using before all annotation', async ({ assert }) => { class MyClass { @BeforeAll() public async beforeAll() {} diff --git a/tests/unit/decorators/BeforeEachDecoratorTest.ts b/tests/unit/decorators/BeforeEachDecoratorTest.ts index 1f9a164..8b5006d 100644 --- a/tests/unit/decorators/BeforeEachDecoratorTest.ts +++ b/tests/unit/decorators/BeforeEachDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, BeforeEach } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('BeforeEachDecoratorTest', () => { - test('should be able to register before each hook of some class using before each decorator', async ({ assert }) => { +test.group('BeforeEachAnnotationTest', () => { + test('should be able to register before each hook of some class using before each annotation', async ({ assert }) => { class MyClass { @BeforeEach() public async beforeEach() {} diff --git a/tests/unit/decorators/CleanupDecoratorTest.ts b/tests/unit/decorators/CleanupDecoratorTest.ts index 5b3e6ce..f7483bd 100644 --- a/tests/unit/decorators/CleanupDecoratorTest.ts +++ b/tests/unit/decorators/CleanupDecoratorTest.ts @@ -12,8 +12,8 @@ import { ObjectBuilder } from '@athenna/common' function cleanup() {} -test.group('CleanupDecoratorTest', () => { - test('should be able to register tests of some class using test and cleanup decorator', async ({ assert }) => { +test.group('CleanupAnnotationTest', () => { + test('should be able to register tests of some class using test and cleanup annotation', async ({ assert }) => { class MyClass { @Test() @Cleanup(cleanup) @@ -29,7 +29,7 @@ test.group('CleanupDecoratorTest', () => { }) }) - test('should be able to register the cleanup decorator without the test decorator', async ({ assert }) => { + test('should be able to register the cleanup annotation without the test annotation', async ({ assert }) => { class MyClass { @Cleanup(cleanup) public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/DisableTimeoutDecoratorTest.ts b/tests/unit/decorators/DisableTimeoutDecoratorTest.ts index 5f78cf8..c427d3c 100644 --- a/tests/unit/decorators/DisableTimeoutDecoratorTest.ts +++ b/tests/unit/decorators/DisableTimeoutDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, DisableTimeout } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('DisableTimeoutDecoratorTest', () => { - test('should be able to register tests of some class using test and disable timeout decorator', async ({ +test.group('DisableTimeoutAnnotationTest', () => { + test('should be able to register tests of some class using test and disable timeout annotation', async ({ assert, }) => { class MyClass { @@ -29,7 +29,7 @@ test.group('DisableTimeoutDecoratorTest', () => { }) }) - test('should be able to register the disable timeout decorator without the test decorator', async ({ assert }) => { + test('should be able to register the disable timeout annotation without the test annotation', async ({ assert }) => { class MyClass { @DisableTimeout() public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/FailsDecoratorTest.ts b/tests/unit/decorators/FailsDecoratorTest.ts index 9e3d8dc..07ae4b9 100644 --- a/tests/unit/decorators/FailsDecoratorTest.ts +++ b/tests/unit/decorators/FailsDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, Fails } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('FailsDecoratorTest', () => { - test('should be able to register tests of some class using test and fails decorator', async ({ assert }) => { +test.group('FailsAnnotationTest', () => { + test('should be able to register tests of some class using test and fails annotation', async ({ assert }) => { class MyClass { @Test() @Fails() @@ -27,7 +27,7 @@ test.group('FailsDecoratorTest', () => { }) }) - test('should be able to register the fails decorator without the test decorator', async ({ assert }) => { + test('should be able to register the fails annotation without the test annotation', async ({ assert }) => { class MyClass { @Fails() public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/PinDecoratorTest.ts b/tests/unit/decorators/PinDecoratorTest.ts index b9ae52a..ff67615 100644 --- a/tests/unit/decorators/PinDecoratorTest.ts +++ b/tests/unit/decorators/PinDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, Pin } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('PinDecoratorTest', () => { - test('should be able to register tests of some class using test and pin decorator', async ({ assert }) => { +test.group('PinAnnotationTest', () => { + test('should be able to register tests of some class using test and pin annotation', async ({ assert }) => { class MyClass { @Test() @Pin() @@ -27,7 +27,7 @@ test.group('PinDecoratorTest', () => { }) }) - test('should be able to register the pin decorator without the test decorator', async ({ assert }) => { + test('should be able to register the pin annotation without the test annotation', async ({ assert }) => { class MyClass { @Pin() public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/RetryDecoratorTest.ts b/tests/unit/decorators/RetryDecoratorTest.ts index 4031891..21051b4 100644 --- a/tests/unit/decorators/RetryDecoratorTest.ts +++ b/tests/unit/decorators/RetryDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, Retry } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('RetryDecoratorTest', () => { - test('should be able to register tests of some class using test and retry decorator', async ({ assert }) => { +test.group('RetryAnnotationTest', () => { + test('should be able to register tests of some class using test and retry annotation', async ({ assert }) => { class MyClass { @Test() @Retry(2) @@ -27,7 +27,7 @@ test.group('RetryDecoratorTest', () => { }) }) - test('should be able to register the retry decorator without the test decorator', async ({ assert }) => { + test('should be able to register the retry annotation without the test annotation', async ({ assert }) => { class MyClass { @Retry(2) public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/SetupDecoratorTest.ts b/tests/unit/decorators/SetupDecoratorTest.ts index 6ee45bd..ffd4404 100644 --- a/tests/unit/decorators/SetupDecoratorTest.ts +++ b/tests/unit/decorators/SetupDecoratorTest.ts @@ -12,8 +12,8 @@ import { ObjectBuilder } from '@athenna/common' function setup() {} -test.group('SetupDecoratorTest', () => { - test('should be able to register tests of some class using test and setup decorator', async ({ assert }) => { +test.group('SetupAnnotationTest', () => { + test('should be able to register tests of some class using test and setup annotation', async ({ assert }) => { class MyClass { @Test() @Setup(setup) @@ -29,7 +29,7 @@ test.group('SetupDecoratorTest', () => { }) }) - test('should be able to register the setup decorator without the test decorator', async ({ assert }) => { + test('should be able to register the setup annotation without the test annotation', async ({ assert }) => { class MyClass { @Setup(setup) public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/SkipDecoratorTest.ts b/tests/unit/decorators/SkipDecoratorTest.ts index f6153f5..d113069 100644 --- a/tests/unit/decorators/SkipDecoratorTest.ts +++ b/tests/unit/decorators/SkipDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, Skip } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('SkipDecoratorTest', () => { - test('should be able to register tests of some class using test and skip decorator', async ({ assert }) => { +test.group('SkipAnnotationTest', () => { + test('should be able to register tests of some class using test and skip annotation', async ({ assert }) => { class MyClass { @Test() @Skip() @@ -27,7 +27,7 @@ test.group('SkipDecoratorTest', () => { }) }) - test('should be able to register the skip decorator without the test decorator', async ({ assert }) => { + test('should be able to register the skip annotation without the test annotation', async ({ assert }) => { class MyClass { @Skip() public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/TagsDecoratorTest.ts b/tests/unit/decorators/TagsDecoratorTest.ts index a54f0f7..8c1ec6e 100644 --- a/tests/unit/decorators/TagsDecoratorTest.ts +++ b/tests/unit/decorators/TagsDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, Tags } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('TagsDecoratorTest', () => { - test('should be able to register tests of some class using test and tags decorator', async ({ assert }) => { +test.group('TagsAnnotationTest', () => { + test('should be able to register tests of some class using test and tags annotation', async ({ assert }) => { class MyClass { @Test() @Tags(['users', 'customers']) @@ -27,7 +27,7 @@ test.group('TagsDecoratorTest', () => { }) }) - test('should be able to register the tags decorator without the test decorator', async ({ assert }) => { + test('should be able to register the tags annotation without the test annotation', async ({ assert }) => { class MyClass { @Tags(['users', 'customers']) public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/TeardownDecoratorTest.ts b/tests/unit/decorators/TeardownDecoratorTest.ts index be9e2d5..c2c4517 100644 --- a/tests/unit/decorators/TeardownDecoratorTest.ts +++ b/tests/unit/decorators/TeardownDecoratorTest.ts @@ -12,8 +12,8 @@ import { ObjectBuilder } from '@athenna/common' function teardown() {} -test.group('TeardownDecoratorTest', () => { - test('should be able to register tests of some class using test and teardown decorator', async ({ assert }) => { +test.group('TeardownAnnotationTest', () => { + test('should be able to register tests of some class using test and teardown annotation', async ({ assert }) => { class MyClass { @Test() @Teardown(teardown) @@ -29,7 +29,7 @@ test.group('TeardownDecoratorTest', () => { }) }) - test('should be able to register the teardown decorator without the test decorator', async ({ assert }) => { + test('should be able to register the teardown annotation without the test annotation', async ({ assert }) => { class MyClass { @Teardown(teardown) public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/TestCaseDecoratorTest.ts b/tests/unit/decorators/TestCaseDecoratorTest.ts index 9b58e85..8570bf3 100644 --- a/tests/unit/decorators/TestCaseDecoratorTest.ts +++ b/tests/unit/decorators/TestCaseDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, TestCase } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('TestCaseDecoratorTest', () => { - test('should be able to register tests of some class using test and test case decorator', async ({ assert }) => { +test.group('TestCaseAnnotationTest', () => { + test('should be able to register tests of some class using test and test case annotation', async ({ assert }) => { class MyClass { @Test() @TestCase('lenon@athenna.io') @@ -27,7 +27,7 @@ test.group('TestCaseDecoratorTest', () => { }) }) - test('should be able to register the test case decorator without the test decorator', async ({ assert }) => { + test('should be able to register the test case annotation without the test annotation', async ({ assert }) => { class MyClass { @TestCase('lenon@athenna.io') public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/TestDecoratorTest.ts b/tests/unit/decorators/TestDecoratorTest.ts index 9df76e1..423386b 100644 --- a/tests/unit/decorators/TestDecoratorTest.ts +++ b/tests/unit/decorators/TestDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('TestDecoratorTest', () => { - test('should be able to register tests of some class using test decorator', async ({ assert }) => { +test.group('TestAnnotationTest', () => { + test('should be able to register tests of some class using test annotation', async ({ assert }) => { class MyClass { @Test() public async shouldBeAbleToRun() {} diff --git a/tests/unit/decorators/TimeoutDecoratorTest.ts b/tests/unit/decorators/TimeoutDecoratorTest.ts index 9455fe0..f3aad53 100644 --- a/tests/unit/decorators/TimeoutDecoratorTest.ts +++ b/tests/unit/decorators/TimeoutDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, Timeout } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('TimeoutDecoratorTest', () => { - test('should be able to register tests of some class using test and timeout decorator', async ({ assert }) => { +test.group('TimeoutAnnotationTest', () => { + test('should be able to register tests of some class using test and timeout annotation', async ({ assert }) => { class MyClass { @Test() @Timeout(10000) @@ -27,7 +27,7 @@ test.group('TimeoutDecoratorTest', () => { }) }) - test('should be able to register the timeout decorator without the test decorator', async ({ assert }) => { + test('should be able to register the timeout annotation without the test annotation', async ({ assert }) => { class MyClass { @Timeout(10000) public async thisWillBeIgnored() {} diff --git a/tests/unit/decorators/WaitForDoneDecoratorTest.ts b/tests/unit/decorators/WaitForDoneDecoratorTest.ts index d11eed5..51848a3 100644 --- a/tests/unit/decorators/WaitForDoneDecoratorTest.ts +++ b/tests/unit/decorators/WaitForDoneDecoratorTest.ts @@ -10,8 +10,8 @@ import { test, Test, WaitForDone } from '#src' import { ObjectBuilder } from '@athenna/common' -test.group('WaitForDoneDecoratorTest', () => { - test('should be able to register tests of some class using test and waitForDone decorator', async ({ assert }) => { +test.group('WaitForDoneAnnotationTest', () => { + test('should be able to register tests of some class using test and waitForDone annotation', async ({ assert }) => { class MyClass { @Test() @WaitForDone() @@ -27,7 +27,7 @@ test.group('WaitForDoneDecoratorTest', () => { }) }) - test('should be able to register the waitForDone decorator without the test decorator', async ({ assert }) => { + test('should be able to register the waitForDone annotation without the test annotation', async ({ assert }) => { class MyClass { @WaitForDone() public async thisWillBeIgnored() {} From eec1214b8963a97d4087ffdf28a40d5e17d2da4f Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 28 Jun 2023 21:44:48 +0000 Subject: [PATCH 2/4] fix: upgrade @japa/spec-reporter from 1.3.2 to 1.3.3 Snyk has created this PR to upgrade @japa/spec-reporter from 1.3.2 to 1.3.3. See this package in npm: https://www.npmjs.com/package/@japa/spec-reporter See this project in Snyk: https://app.snyk.io/org/jlenon7/project/97097eb1-6953-4d11-a9f3-958b2ecba250?utm_source=github&utm_medium=referral&page=upgrade-pr --- package-lock.json | 27 ++++++++++++--------------- package.json | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 957f15f..2d269a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@japa/assert": "^1.3.6", "@japa/run-failed-tests": "^1.1.0", "@japa/runner": "^2.2.2", - "@japa/spec-reporter": "^1.3.2", + "@japa/spec-reporter": "^1.3.3", "@types/sinon": "^10.0.13", "sinon": "^15.0.1" }, @@ -631,16 +631,13 @@ } }, "node_modules/@japa/base-reporter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@japa/base-reporter/-/base-reporter-1.1.0.tgz", - "integrity": "sha512-svEQ3OlzhrnCGTgP61UfFt1WsnQuLSOJ3m79E6Q44ynoG26V0RiwFA5m078JkoTl22bD1/aK8LJSleHopUjQTg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@japa/base-reporter/-/base-reporter-1.1.2.tgz", + "integrity": "sha512-6MYs/EsXjouFPNUQL3VGllryZ5enI5rqhvQbY2Dzh3Zmhu22DWw6v9d2pxucrFptDTtQ38MBPVL/BIeZAafmOw==", "dependencies": { - "@japa/errors-printer": "^2.0.1", - "@poppinss/cliui": "^3.0.4", + "@japa/errors-printer": "^2.1.0", + "@poppinss/cliui": "^3.0.5", "ms": "^2.1.3" - }, - "peerDependencies": { - "@japa/core": "^7.0.0" } }, "node_modules/@japa/core": { @@ -707,13 +704,13 @@ } }, "node_modules/@japa/spec-reporter": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@japa/spec-reporter/-/spec-reporter-1.3.2.tgz", - "integrity": "sha512-XfJaw1dHjBfZfpKt+k2T1mPGlgZa3I0ZujmB0D0SFoHqus0yCCaiPeocoeHYPtuGETqxHdsNz3yQBX0cyOMxHQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@japa/spec-reporter/-/spec-reporter-1.3.3.tgz", + "integrity": "sha512-EOOjvQVmmWZDKxmO+f0v/BSNeKzKkeJSrNwEldkF40zZWdHX2J3Jb2MJowE5DgSOQCiG/OG2UFen0I+XLnPoxQ==", "dependencies": { - "@japa/base-reporter": "^1.1.0", - "@japa/errors-printer": "^2.0.1", - "@poppinss/cliui": "^3.0.4", + "@japa/base-reporter": "^1.1.1", + "@japa/errors-printer": "^2.1.0", + "@poppinss/cliui": "^3.0.5", "ms": "^2.1.3" } }, diff --git a/package.json b/package.json index 0a3e22e..cb3e223 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@japa/assert": "^1.3.6", "@japa/run-failed-tests": "^1.1.0", "@japa/runner": "^2.2.2", - "@japa/spec-reporter": "^1.3.2", + "@japa/spec-reporter": "^1.3.3", "@types/sinon": "^10.0.13", "sinon": "^15.0.1" }, From 3d5c8c826841cd1d2d23548117fc2c1bb14d5d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Thu, 29 Jun 2023 13:06:16 -0300 Subject: [PATCH 3/4] chore(structure): separate concerns --- bin/test.ts | 6 +- package-lock.json | 176 ++++++++---------- package.json | 5 +- src/annotations/AfterAll.ts | 2 +- src/annotations/AfterEach.ts | 2 +- src/annotations/BeforeAll.ts | 2 +- src/annotations/BeforeEach.ts | 2 +- src/annotations/Cleanup.ts | 4 +- src/annotations/DisableTimeout.ts | 2 +- src/annotations/Fails.ts | 2 +- src/annotations/Pin.ts | 2 +- src/annotations/Retry.ts | 2 +- src/annotations/Setup.ts | 4 +- src/annotations/Skip.ts | 2 +- src/annotations/Tags.ts | 2 +- src/annotations/Teardown.ts | 4 +- src/annotations/Test.ts | 2 +- src/annotations/TestCase.ts | 2 +- src/annotations/Timeout.ts | 2 +- src/annotations/WaitForDone.ts | 2 +- src/converters/TestConverter.ts | 225 ++++++++++++++++++++--- src/debug/index.ts | 12 ++ src/helpers/ExitFaker.ts | 6 +- src/helpers/Importer.ts | 145 ++------------- src/helpers/Runner.ts | 46 ++++- src/types/{Options.ts => TestOptions.ts} | 2 +- src/types/index.ts | 2 +- tsconfig.json | 3 +- 28 files changed, 373 insertions(+), 295 deletions(-) create mode 100644 src/debug/index.ts rename src/types/{Options.ts => TestOptions.ts} (95%) diff --git a/bin/test.ts b/bin/test.ts index 37538a9..b2e5491 100644 --- a/bin/test.ts +++ b/bin/test.ts @@ -7,11 +7,11 @@ * file that was distributed with this source code. */ -import { Runner, assert, specReporter } from '#src' +import { Runner } from '#src' await Runner.setTsEnv() - .addPlugin(assert()) - .addReporter(specReporter()) + .addAssertPlugin() + .addSpecReporter() .addPath('tests/unit/**/*Test.ts') .setCliArgs(process.argv.slice(2)) .setGlobalTimeout(10000) diff --git a/package-lock.json b/package-lock.json index 957f15f..399ba30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/test", - "version": "4.1.0", + "version": "4.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/test", - "version": "4.1.0", + "version": "4.2.0", "license": "MIT", "dependencies": { "@japa/assert": "^1.3.6", @@ -17,7 +17,7 @@ "sinon": "^15.0.1" }, "devDependencies": { - "@athenna/common": "^3.6.0", + "@athenna/common": "^4.2.0", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", "c8": "^5.0.2", @@ -65,9 +65,9 @@ "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==" }, "node_modules/@athenna/common": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@athenna/common/-/common-3.6.0.tgz", - "integrity": "sha512-5/KAJ2wE1PVyp/lqV+Pf+gXnzrGyncl4jdL/2fcoq8xOx1etVwh9FtekxhSqHce/OjuHuCzd+4IO7/h31WhvhQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.2.0.tgz", + "integrity": "sha512-NT7lrNpW2WqKT6TyXJAysfFT3w6IfyaRdivDRzsSk6/lz0nq8pjZhITP9EUK10mdhmjBYTBcMCVO1JR3j1GZ4w==", "dev": true, "dependencies": { "@fastify/formbody": "^7.4.0", @@ -75,10 +75,9 @@ "callsite": "^1.0.0", "chalk": "^5.2.0", "change-case": "^4.1.2", - "collect.js": "^4.34.3", - "debug": "^4.3.4", - "fastify": "^4.15.0", - "got": "^12.6.0", + "collect.js": "^4.36.1", + "fastify": "^4.16.3", + "got": "^12.6.1", "http-status-codes": "^2.2.0", "is-wsl": "^2.2.0", "kind-of": "^6.0.3", @@ -469,18 +468,18 @@ "dev": true }, "node_modules/@fastify/error": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz", - "integrity": "sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.3.0.tgz", + "integrity": "sha512-dj7vjIn1Ar8sVXj2yAXiMNCJDmS9MQ9XMlIecX2dIzzhjSHCyKo4DdXjXMs7wKW2kj6yvVRSpuQjOZ3YLrh56w==", "dev": true }, "node_modules/@fastify/fast-json-stringify-compiler": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.2.0.tgz", - "integrity": "sha512-ypZynRvXA3dibfPykQN3RB5wBdEUgSGgny8Qc6k163wYPLD4mEGEDkACp+00YmqkGvIm8D/xYoHajwyEdWD/eg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", + "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", "dev": true, "dependencies": { - "fast-json-stringify": "^5.0.0" + "fast-json-stringify": "^5.7.0" } }, "node_modules/@fastify/formbody": { @@ -834,9 +833,9 @@ "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==" }, "node_modules/@sindresorhus/is": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", - "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.4.1.tgz", + "integrity": "sha512-axlrvsHlHlFmKKMEg4VyvMzFr93JWJj4eIfXY1STVuO2fsImCa7ncaiG5gC8HKOX590AW5RtRsC41/B+OfrSqw==", "dev": true, "engines": { "node": ">=14.16" @@ -1973,9 +1972,9 @@ } }, "node_modules/cacheable-request": { - "version": "10.2.9", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.9.tgz", - "integrity": "sha512-CaAMr53AS1Tb9evO1BIWFnZjSr8A4pbXofpsNVWPMDZZj3ZQKHwsQG9BrTqQ4x5ZYJXz1T2b8LLtTZODxSpzbg==", + "version": "10.2.12", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.12.tgz", + "integrity": "sha512-qtWGB5kn2OLjx47pYUkWicyOpK1vy9XZhq8yRTXOy+KAmjjESSRLx6SiExnnaGGUP1NM6/vmygMu0fGylNh9tw==", "dev": true, "dependencies": { "@types/http-cache-semantics": "^4.0.1", @@ -1990,18 +1989,6 @@ "node": ">=14.16" } }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cachedir": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", @@ -2385,9 +2372,9 @@ } }, "node_modules/collect.js": { - "version": "4.34.3", - "resolved": "https://registry.npmjs.org/collect.js/-/collect.js-4.34.3.tgz", - "integrity": "sha512-aFr67xDazPwthsGm729mnClgNuh15JEagU6McKBKqxuHOkWL7vMFzGbhsXDdPZ+H6ia5QKIMGYuGOMENBHnVpg==", + "version": "4.36.1", + "resolved": "https://registry.npmjs.org/collect.js/-/collect.js-4.36.1.tgz", + "integrity": "sha512-jd97xWPKgHn6uvK31V6zcyPd40lUJd7gpYxbN2VOVxGWO4tyvS9Li4EpsFjXepGTo2tYcOTC4a8YsbQXMJ4XUw==", "dev": true }, "node_modules/color-convert": { @@ -3604,9 +3591,9 @@ } }, "node_modules/fast-redact": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.2.tgz", - "integrity": "sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.2.0.tgz", + "integrity": "sha512-zaTadChr+NekyzallAMXATXLOR8MNx3zqpZ0MUF2aGf4EathnG0f32VLODNlY8IuGY3HoRO2L6/6fSzNsLaHIw==", "dev": true, "engines": { "node": ">=6" @@ -3619,26 +3606,27 @@ "dev": true }, "node_modules/fastify": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.15.0.tgz", - "integrity": "sha512-m/CaRN8nf5uyYdrDe2qqq+0z3oGyE+A++qlKQoLJTI4WI0nWK9D6R3FxXQ3MVwt/md977GMR4F43pE9oqrS2zw==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.18.0.tgz", + "integrity": "sha512-L5o/2GEkBastQ3HV0dtKo7SUZ497Z1+q4fcqAoPyq6JCQ/8zdk1JQEoTQwnBWCp+EmA7AQa6mxNqSAEhzP0RwQ==", "dev": true, "dependencies": { "@fastify/ajv-compiler": "^3.5.0", - "@fastify/error": "^3.0.0", - "@fastify/fast-json-stringify-compiler": "^4.2.0", + "@fastify/error": "^3.2.0", + "@fastify/fast-json-stringify-compiler": "^4.3.0", "abstract-logging": "^2.0.1", - "avvio": "^8.2.0", + "avvio": "^8.2.1", "fast-content-type-parse": "^1.0.0", + "fast-json-stringify": "^5.7.0", "find-my-way": "^7.6.0", - "light-my-request": "^5.6.1", - "pino": "^8.5.0", - "process-warning": "^2.0.0", + "light-my-request": "^5.9.1", + "pino": "^8.12.0", + "process-warning": "^2.2.0", "proxy-addr": "^2.0.7", "rfdc": "^1.3.0", "secure-json-parse": "^2.5.0", - "semver": "^7.3.7", - "tiny-lru": "^10.0.0" + "semver": "^7.5.0", + "tiny-lru": "^11.0.1" } }, "node_modules/fastify-plugin": { @@ -3648,9 +3636,9 @@ "dev": true }, "node_modules/fastify/node_modules/semver": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", - "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3734,9 +3722,9 @@ } }, "node_modules/find-my-way": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.6.0.tgz", - "integrity": "sha512-H7berWdHJ+5CNVr4ilLWPai4ml7Y2qAsxjw3pfeBxPigZmaDTzF0wjJLj90xRCmGcWYcyt050yN+34OZDJm1eQ==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.6.2.tgz", + "integrity": "sha512-0OjHn1b1nCX3eVbm9ByeEHiscPYiHLfhei1wOUU9qffQkk98wE0Lo8VrVYfSGMgnSnDh86DxedduAnBf4nwUEw==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", @@ -4007,6 +3995,18 @@ "source-map": "^0.6.1" } }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", @@ -4178,9 +4178,9 @@ } }, "node_modules/got": { - "version": "12.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.0.tgz", - "integrity": "sha512-WTcaQ963xV97MN3x0/CbAriXFZcXCfgxVp91I+Ze6pawQOa7SgzwSx2zIJJsX+kTajMnVs0xcFD1TxZKFqhdnQ==", + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", "dev": true, "dependencies": { "@sindresorhus/is": "^5.2.0", @@ -4202,18 +4202,6 @@ "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/got/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", @@ -5204,9 +5192,9 @@ } }, "node_modules/light-my-request": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.9.1.tgz", - "integrity": "sha512-UT7pUk8jNCR1wR7w3iWfIjx32DiB2f3hFdQSOwy3/EPQ3n3VocyipUxcyRZR0ahoev+fky69uA+GejPa9KuHKg==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.10.0.tgz", + "integrity": "sha512-ZU2D9GmAcOUculTTdH9/zryej6n8TzT+fNGdNtm6SDp5MMMpHrJJkvAdE3c6d8d2chE9i+a//dS9CWZtisknqA==", "dev": true, "dependencies": { "cookie": "^0.5.0", @@ -5284,18 +5272,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/lint-staged/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lint-staged/node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -6237,9 +6213,9 @@ } }, "node_modules/pino": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.11.0.tgz", - "integrity": "sha512-Z2eKSvlrl2rH8p5eveNUnTdd4AjJk8tAsLkHYZQKGHP4WTh2Gi1cOSOs3eWPqaj+niS3gj4UkoreoaWgF3ZWYg==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/pino/-/pino-8.14.1.tgz", + "integrity": "sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw==", "dev": true, "dependencies": { "atomic-sleep": "^1.0.0", @@ -6293,9 +6269,9 @@ } }, "node_modules/pino-abstract-transport/node_modules/readable-stream": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.3.0.tgz", - "integrity": "sha512-MuEnA0lbSi7JS8XM+WNJlWZkHAAdm7gETHdFK//Q/mChGyj2akEFtdLZh32jSdkWGbRwCW9pn6g3LWDdDeZnBQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.1.tgz", + "integrity": "sha512-llAHX9QC25bz5RPIoTeJxPaA/hgryaldValRhVZ2fK9bzbmFiscpz8fw6iBTvJfAk1w4FC1KXQme/nO7fbKyKg==", "dev": true, "dependencies": { "abort-controller": "^3.0.0", @@ -6308,9 +6284,9 @@ } }, "node_modules/pino-std-serializers": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.0.tgz", - "integrity": "sha512-IWgSzUL8X1w4BIWTwErRgtV8PyOGOOi60uqv0oKuS/fOA8Nco/OeI6lBuc4dyP8MMfdFwyHqTMcBIA7nDiqEqA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", "dev": true }, "node_modules/pkg-dir": { @@ -7587,9 +7563,9 @@ } }, "node_modules/tiny-lru": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-10.4.1.tgz", - "integrity": "sha512-buLIzw7ppqymuO3pt10jHk/6QMeZLbidihMQU+N6sogF6EnBzG0qtDWIHuhw1x3dyNgVL/KTGIZsTK81+yCzLg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-11.0.1.tgz", + "integrity": "sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg==", "dev": true, "engines": { "node": ">=12" diff --git a/package.json b/package.json index 0a3e22e..8e2c89b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/test", - "version": "4.1.0", + "version": "4.2.0", "description": "The Athenna test runner. Built on top of Japa.", "license": "MIT", "author": "João Lenon ", @@ -44,6 +44,7 @@ "#src/*": "./src/*.js", "#src": "./src/index.js", "#src/types": "./src/types/index.js", + "#src/debug": "./src/debug/index.js", "#tests/*": "./tests/*.js", "#tests": "./tests/index.js" }, @@ -56,7 +57,7 @@ "sinon": "^15.0.1" }, "devDependencies": { - "@athenna/common": "^3.6.0", + "@athenna/common": "^4.2.0", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", "c8": "^5.0.2", diff --git a/src/annotations/AfterAll.ts b/src/annotations/AfterAll.ts index 74a9848..9da2dd8 100644 --- a/src/annotations/AfterAll.ts +++ b/src/annotations/AfterAll.ts @@ -14,7 +14,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Create a new after all (teardown) hook. */ -export function AfterAll(): MethodAnnotation { +export function AfterAll(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/AfterEach.ts b/src/annotations/AfterEach.ts index c63ae74..9510d3e 100644 --- a/src/annotations/AfterEach.ts +++ b/src/annotations/AfterEach.ts @@ -14,7 +14,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Create a new after each (teardown.each) hook. */ -export function AfterEach(): MethodAnnotation { +export function AfterEach(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/BeforeAll.ts b/src/annotations/BeforeAll.ts index f4fb849..ea6518e 100644 --- a/src/annotations/BeforeAll.ts +++ b/src/annotations/BeforeAll.ts @@ -14,7 +14,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Create a new before all (setup) hook. */ -export function BeforeAll(): MethodAnnotation { +export function BeforeAll(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/BeforeEach.ts b/src/annotations/BeforeEach.ts index fe59ea2..7563ed9 100644 --- a/src/annotations/BeforeEach.ts +++ b/src/annotations/BeforeEach.ts @@ -14,7 +14,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Create a new before each (setup.each) hook. */ -export function BeforeEach(): MethodAnnotation { +export function BeforeEach(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Cleanup.ts b/src/annotations/Cleanup.ts index 5399932..5864eb7 100644 --- a/src/annotations/Cleanup.ts +++ b/src/annotations/Cleanup.ts @@ -9,14 +9,14 @@ import 'reflect-metadata' -import type { Context, CleanupHandler } from '#src/types' import { ObjectBuilder } from '@athenna/common' import { Annotation } from '#src/helpers/Annotation' +import type { Context, CleanupHandler } from '#src/types' /** * Register a cleanup hook from within the test. */ -export function Cleanup(handler: CleanupHandler): MethodAnnotation { +export function Cleanup(handler: CleanupHandler): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/DisableTimeout.ts b/src/annotations/DisableTimeout.ts index e32c5b4..ada5f9e 100644 --- a/src/annotations/DisableTimeout.ts +++ b/src/annotations/DisableTimeout.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Disable test timeout. It is the same as calling `test.timeout(0)` */ -export function DisableTimeout(): MethodAnnotation { +export function DisableTimeout(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Fails.ts b/src/annotations/Fails.ts index aa9e6e4..7fc94cb 100644 --- a/src/annotations/Fails.ts +++ b/src/annotations/Fails.ts @@ -16,7 +16,7 @@ import { Annotation } from '#src/helpers/Annotation' * Expect the test to fail. Helpful in creating test cases to * showcase bugs. */ -export function Fails(): MethodAnnotation { +export function Fails(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Pin.ts b/src/annotations/Pin.ts index a8d3f62..70050d2 100644 --- a/src/annotations/Pin.ts +++ b/src/annotations/Pin.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Pin the test. If one test is pinned, Japa will run only pinned tests. */ -export function Pin(): MethodAnnotation { +export function Pin(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Retry.ts b/src/annotations/Retry.ts index 634d693..7527bdd 100644 --- a/src/annotations/Retry.ts +++ b/src/annotations/Retry.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Configure the number of times this test should be retried when failing. */ -export function Retry(times: number): MethodAnnotation { +export function Retry(times: number): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Setup.ts b/src/annotations/Setup.ts index c17f8be..a01032a 100644 --- a/src/annotations/Setup.ts +++ b/src/annotations/Setup.ts @@ -9,14 +9,14 @@ import 'reflect-metadata' -import type { Context, SetupHandler } from '#src/types' import { ObjectBuilder } from '@athenna/common' import { Annotation } from '#src/helpers/Annotation' +import type { Context, SetupHandler } from '#src/types' /** * Register a setup hook from within the test. */ -export function Setup(handler: SetupHandler): MethodAnnotation { +export function Setup(handler: SetupHandler): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Skip.ts b/src/annotations/Skip.ts index c6b7a77..425e181 100644 --- a/src/annotations/Skip.ts +++ b/src/annotations/Skip.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Skip the test conditionally. */ -export function Skip(reason?: string): MethodAnnotation { +export function Skip(reason?: string): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Tags.ts b/src/annotations/Tags.ts index 25ee956..0fa48d8 100644 --- a/src/annotations/Tags.ts +++ b/src/annotations/Tags.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Assign tags to the test. Later you can use the tags to run specific tests. */ -export function Tags(tags: string[]): MethodAnnotation { +export function Tags(tags: string[]): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Teardown.ts b/src/annotations/Teardown.ts index 3e7a3d2..f08fd2a 100644 --- a/src/annotations/Teardown.ts +++ b/src/annotations/Teardown.ts @@ -9,14 +9,14 @@ import 'reflect-metadata' -import type { Context, TeardownHandler } from '#src/types' import { ObjectBuilder } from '@athenna/common' import { Annotation } from '#src/helpers/Annotation' +import type { Context, TeardownHandler } from '#src/types' /** * Register a teardown hook from within the test. */ -export function Teardown(handler: TeardownHandler): MethodAnnotation { +export function Teardown(handler: TeardownHandler): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Test.ts b/src/annotations/Test.ts index 074b83d..afe0e35 100644 --- a/src/annotations/Test.ts +++ b/src/annotations/Test.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Create a new test. */ -export function Test(title?: string): MethodAnnotation { +export function Test(title?: string): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/TestCase.ts b/src/annotations/TestCase.ts index e42bcc7..ee52cb6 100644 --- a/src/annotations/TestCase.ts +++ b/src/annotations/TestCase.ts @@ -16,7 +16,7 @@ import { Annotation } from '#src/helpers/Annotation' * Define the dataset for the test case. The test executor will be invoked * for all the items inside the dataset array. */ -export function TestCase(value: any): MethodAnnotation { +export function TestCase(value: any): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/Timeout.ts b/src/annotations/Timeout.ts index 6846136..ff234a4 100644 --- a/src/annotations/Timeout.ts +++ b/src/annotations/Timeout.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Set the test timeout. */ -export function Timeout(timeout: number): MethodAnnotation { +export function Timeout(timeout: number): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/annotations/WaitForDone.ts b/src/annotations/WaitForDone.ts index 4b6182d..e642994 100644 --- a/src/annotations/WaitForDone.ts +++ b/src/annotations/WaitForDone.ts @@ -15,7 +15,7 @@ import { Annotation } from '#src/helpers/Annotation' /** * Wait for the test executor to call done method. */ -export function WaitForDone(): MethodAnnotation { +export function WaitForDone(): MethodDecorator { return (target: any, property: string, _: any) => { const Target = target.constructor diff --git a/src/converters/TestConverter.ts b/src/converters/TestConverter.ts index 391d974..8a0e6df 100644 --- a/src/converters/TestConverter.ts +++ b/src/converters/TestConverter.ts @@ -7,54 +7,221 @@ * file that was distributed with this source code. */ -import type { Options } from '#src/types' -import { Is } from '@athenna/common' +import { debug } from '#src/debug' import { test as japaTest } from '#src' +import type { Group } from '@japa/runner' +import type { TestOptions } from '#src/types' +import { Is, ObjectBuilder, Options } from '@athenna/common' +import { AfterAllHookException } from '#src/exceptions/AfterAllHookException' +import { BeforeAllHookException } from '#src/exceptions/BeforeAllHookException' +import { AfterEachHookException } from '#src/exceptions/AfterEachHookException' +import { BeforeEachHookException } from '#src/exceptions/BeforeEachHookException' export class TestConverter { /** - * Convert test options of annotation to Japa test options. + * The test class instance. */ - public static async convert(closure: any, options: Options) { - if (!closure) { - return - } + private readonly testClass: any + + /** + * The test class constructor. + */ + private readonly TestClass: any + + /** + * The test class name. + */ + private readonly className: string + + public constructor(Test: any) { + this.testClass = new Test() + this.TestClass = this.testClass.constructor + this.className = this.TestClass.name + } - const test = japaTest(options.title) + public registerGroup() { + japaTest.group(this.className, group => { + this.beforeAll(group) + this.beforeEach(group) + this.afterAll(group) + this.afterEach(group) + this.tests() + }) + } + + /** + * Register all @Test annotations. + */ + public tests() { + const tests = + Reflect.getMetadata('tests', this.TestClass) || + new ObjectBuilder({ referencedValues: true }) - this.whenDefined(options.pin, () => test.pin()) - this.whenDefined(options.fails, () => test.fails()) - this.whenDefined(options.waitForDone, () => test.waitForDone()) - this.whenDefined(options.disableTimeout, () => test.disableTimeout()) + tests.forEachKey(method => { + const closure = Options.bind(this.testClass, method) + const options: TestOptions = tests.get(method) - this.whenDefined(options.tags, tags => test.tags(tags)) - this.whenDefined(options.with, cases => test.with(cases)) - this.whenDefined(options.retry, times => test.retry(times)) - this.whenDefined(options.setup, setup => test.setup(setup)) - this.whenDefined(options.timeout, timeout => test.timeout(timeout)) - this.whenDefined(options.cleanup, cleanup => test.cleanup(cleanup)) - this.whenDefined(options.teardown, teardown => test.teardown(teardown)) - this.whenDefined(options.skip, skip => { - if (Is.Boolean(skip)) { - test.skip(skip) + if (!closure) { + this.debugClosure('@Test', method) return } - test.skip(true, skip) + const test = japaTest(options.title) + + Options.whenDefined(options.pin, () => test.pin()) + Options.whenDefined(options.fails, () => test.fails()) + Options.whenDefined(options.waitForDone, () => test.waitForDone()) + Options.whenDefined(options.disableTimeout, () => test.disableTimeout()) + + Options.whenDefined(options.tags, tags => test.tags(tags)) + Options.whenDefined(options.with, cases => test.with(cases)) + Options.whenDefined(options.retry, times => test.retry(times)) + Options.whenDefined(options.setup, setup => test.setup(setup)) + Options.whenDefined(options.timeout, timeout => test.timeout(timeout)) + Options.whenDefined(options.cleanup, cleanup => test.cleanup(cleanup)) + Options.whenDefined(options.teardown, teardown => test.teardown(teardown)) + Options.whenDefined(options.skip, skip => { + if (Is.Boolean(skip)) { + test.skip(skip) + + return + } + + test.skip(true, skip) + }) + + test.run(closure) }) + } + + /** + * Register all @BeforeAll annotations. + */ + public beforeAll(group: Group) { + const hooks = Reflect.getMetadata('hooks:beforeAll', this.TestClass) || [] + + hooks.forEach(({ method }) => { + const closure = Options.bind(this.testClass, method) + + if (!closure) { + this.debugClosure('@BeforeAll', method) + + return + } + + const hookHandler = this.handleHook( + method, + closure, + BeforeAllHookException, + ) - test.run(closure) + group.setup(hookHandler) + }) } /** - * Execute some closure when a statement is defined. + * Register all @BeforeEach annotations. */ - private static whenDefined(statement: any, closure: any) { - if (!Is.Defined(statement)) { - return + public beforeEach(group: Group) { + const hooks = Reflect.getMetadata('hooks:beforeEach', this.TestClass) || [] + + hooks.forEach(({ method }) => { + const closure = Options.bind(this.testClass, method) + + if (!closure) { + this.debugClosure('@BeforeEach', method) + + return + } + + const hookHandler = this.handleHook( + method, + closure, + BeforeEachHookException, + ) + + group.each.setup(hookHandler) + }) + } + + /** + * Register all @AfterAll annotations. + */ + public afterAll(group: Group) { + const hooks = Reflect.getMetadata('hooks:afterAll', this.TestClass) || [] + + hooks.forEach(({ method }) => { + const closure = Options.bind(this.testClass, method) + + if (!closure) { + this.debugClosure('@AfterAll', method) + + return + } + + const hookHandler = this.handleHook( + method, + closure, + AfterAllHookException, + ) + + group.teardown(hookHandler) + }) + } + + /** + * Register all @AfterEach annotations. + */ + public afterEach(group: Group) { + const hooks = Reflect.getMetadata('hooks:afterEach', this.TestClass) || [] + + hooks.forEach(({ method }) => { + const closure = Options.bind(this.testClass, method) + + if (!closure) { + this.debugClosure('@AfterEach', method) + + return + } + + const hookHandler = this.handleHook( + method, + closure, + AfterEachHookException, + ) + + group.each.teardown(hookHandler) + }) + } + + /** + * Creates a new closure to handle hook execution and errors. + */ + private handleHook(method: string, closure: any, Exception: any) { + return async () => { + try { + await closure() + } catch (error) { + const exception = new Exception(method, this.className, error) + + console.error(await exception.prettify()) + process.exit(1) + } } + } - closure(statement) + /** + * Create a new debug log of an undefined closure in the test + * class. + */ + private debugClosure(annotation: string, method: string) { + debug( + 'Skipping registration of %s annotation for %s method. There is no method called %s in %s class.', + annotation, + method, + method, + this.className, + ) } } diff --git a/src/debug/index.ts b/src/debug/index.ts new file mode 100644 index 0000000..758c7a6 --- /dev/null +++ b/src/debug/index.ts @@ -0,0 +1,12 @@ +/** + * @athenna/test + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { debuglog } from 'node:util' + +export const debug = debuglog('athenna:test') diff --git a/src/helpers/ExitFaker.ts b/src/helpers/ExitFaker.ts index 1133bac..7334fc8 100644 --- a/src/helpers/ExitFaker.ts +++ b/src/helpers/ExitFaker.ts @@ -7,15 +7,15 @@ * file that was distributed with this source code. */ -import type { SinonSpy } from 'sinon' import { fake } from 'sinon' +import type { SinonSpy } from 'sinon' export class ExitFaker { public static original = process.exit public static faker: SinonSpy<[code?: number], never> /** - * Fake the process.exit method. + * Fake the process.exit() method. */ public static fake(): typeof ExitFaker { this.faker = fake() as SinonSpy<[code?: number], never> @@ -25,7 +25,7 @@ export class ExitFaker { } /** - * Release the faker process.exit method. + * Release the faker process.exit() method. */ public static release(): typeof ExitFaker { this.faker = undefined diff --git a/src/helpers/Importer.ts b/src/helpers/Importer.ts index 30eca6d..fcda004 100644 --- a/src/helpers/Importer.ts +++ b/src/helpers/Importer.ts @@ -7,153 +7,30 @@ * file that was distributed with this source code. */ -import { pathToFileURL } from 'node:url' -import { test as japaTest } from '@japa/runner' -import { Module, ObjectBuilder } from '@athenna/common' +import { parse } from 'node:path' +import { debug } from '#src/debug' +import { Module } from '@athenna/common' import { TestConverter } from '#src/converters/TestConverter' -import { AfterAllHookException } from '#src/exceptions/AfterAllHookException' -import { AfterEachHookException } from '#src/exceptions/AfterEachHookException' -import { BeforeAllHookException } from '#src/exceptions/BeforeAllHookException' -import { BeforeEachHookException } from '#src/exceptions/BeforeEachHookException' export class Importer { - /** - * Simple imports some file path by href. - */ - public static async simpleImport(filePath: string): Promise { - return import(pathToFileURL(filePath).href) - } - /** * Import some japa test file and resolve the that class if exists. */ public static async import(filePath: string) { - const Test = await Module.get(Importer.simpleImport(filePath)) + const Test = await Module.getFrom(filePath) if (!Test) { - return - } - - const test = new Test() - const bind = (method: string) => { - const closure = test[method] - - if (!closure) { - return null - } - - return closure.bind(test) - } - - const { - tests, - afterAllHooks, - afterEachHooks, - beforeAllHooks, - beforeEachHooks, - } = Importer.getClassMetadata(Test) - - japaTest.group(Test.name, group => { - beforeAllHooks.forEach(({ method }) => { - const closure = bind(method) - - if (!closure) return - - group.setup( - Importer.handleHook( - method, - Test.name, - closure, - BeforeAllHookException, - ), - ) - }) - - afterAllHooks.forEach(({ method }) => { - const closure = bind(method) - - if (!closure) return + const fileName = parse(filePath).name - group.teardown( - Importer.handleHook( - method, - Test.name, - closure, - AfterAllHookException, - ), - ) - }) - - beforeEachHooks.forEach(({ method }) => { - const closure = bind(method) - - if (!closure) return - - group.each.setup( - Importer.handleHook( - method, - Test.name, - closure, - BeforeEachHookException, - ), - ) - }) - - afterEachHooks.forEach(({ method }) => { - const closure = bind(method) - - if (!closure) return - - group.each.teardown( - Importer.handleHook( - method, - Test.name, - closure, - AfterEachHookException, - ), - ) - }) - - Object.keys(tests.get()).forEach(method => - TestConverter.convert(bind(method), tests.get(method)), + debug( + 'Skipping class registration of %s file. There is no class being exported at %s path.', + fileName, + filePath, ) - }) - } - /** - * Creates a new closure to handle hook execution and errors. - */ - private static handleHook( - method: string, - className: string, - closure: any, - Exception: any, - ) { - return async () => { - try { - await closure() - } catch (error) { - const exception = new Exception(method, className, error) - - console.error(await exception.prettify()) - process.exit(1) - } + return } - } - /** - * Get all the class metadata or return default empty values to prevent - * errors. - */ - private static getClassMetadata(target: any) { - return { - tests: - Reflect.getMetadata('tests', target) || - new ObjectBuilder({ referencedValues: true }), - afterAllHooks: Reflect.getMetadata('hooks:afterAll', target) || [], - afterEachHooks: Reflect.getMetadata('hooks:afterEach', target) || [], - beforeAllHooks: Reflect.getMetadata('hooks:beforeAll', target) || [], - beforeEachHooks: Reflect.getMetadata('hooks:beforeEach', target) || [], - } + new TestConverter(Test).registerGroup() } } diff --git a/src/helpers/Runner.ts b/src/helpers/Runner.ts index cfbef3d..6e23baa 100644 --- a/src/helpers/Runner.ts +++ b/src/helpers/Runner.ts @@ -7,8 +7,15 @@ * file that was distributed with this source code. */ +import { + Importer, + run, + assert, + configure, + specReporter, + processCliArgs, +} from '#src' import type { Config, PluginFn } from '#src/types' -import { run, configure, processCliArgs, Importer } from '#src' export class Runner { public static files: string[] = [] @@ -65,6 +72,28 @@ export class Runner { return this } + /** + * Add the `assert()` plugin. + * + * @example ```ts + * Runner.addAssertPlugin() + * ``` + */ + public static addAssertPlugin(): typeof Runner { + return this.addPlugin(assert()) + } + + /** + * Add the `specReporter()` plugin. + * + * @example ```ts + * Runner.addSpecReporter() + * ``` + */ + public static addSpecReporter(): typeof Runner { + return this.addReporter(specReporter()) + } + /** * Set the global timeout of all tests. * @@ -132,6 +161,21 @@ export class Runner { return this } + /** + * Set the `NODE_ENV` and `APP_ENV` environments. + * + * @example ```ts + * Runner.setNodeEnv() + * Runner.setNodeEnv('test') + * ``` + */ + public static setNodeEnv(env = 'test'): typeof Runner { + process.env.APP_ENV = env + process.env.NODE_ENV = env + + return this + } + /** * Parse all your configurations and run the tests. * diff --git a/src/types/Options.ts b/src/types/TestOptions.ts similarity index 95% rename from src/types/Options.ts rename to src/types/TestOptions.ts index 8061528..86a0572 100644 --- a/src/types/Options.ts +++ b/src/types/TestOptions.ts @@ -10,7 +10,7 @@ import type { Context } from '#src/types/Context' import type { TestHooksHandler, TestHooksCleanupHandler } from '@japa/core' -export interface Options { +export interface TestOptions { title?: string pin?: boolean fails?: boolean diff --git a/src/types/index.ts b/src/types/index.ts index 0189c6d..30c3646 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -10,7 +10,7 @@ export type { Config, PluginFn } from '@japa/runner' export * from '#src/types/Context' -export * from '#src/types/Options' +export * from '#src/types/TestOptions' export * from '#src/types/SetupHandler' export * from '#src/types/CleanupHandler' export * from '#src/types/TeardownHandler' diff --git a/tsconfig.json b/tsconfig.json index 5a20cac..1999c40 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,8 @@ "#bin/*": ["./bin/*.ts"], "#src/*": ["./src/*.ts"], "#tests/*": ["./tests/*.ts"], - "#src/types": ["./src/types/index.ts"] + "#src/types": ["./src/types/index.ts"], + "#src/debug": ["./src/debug/index.ts"] } }, "include": ["./**/*"], From 876774d974fa59db48f1263f9a0c3b962248d56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Thu, 29 Jun 2023 13:18:50 -0300 Subject: [PATCH 4/4] chore(npm): update dependencies --- package-lock.json | 475 +++++++++++++++++++++++++--------------------- package.json | 8 +- 2 files changed, 264 insertions(+), 219 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21f5859..53967e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,19 +9,19 @@ "version": "4.2.0", "license": "MIT", "dependencies": { - "@japa/assert": "^1.3.6", + "@japa/assert": "^1.4.1", "@japa/run-failed-tests": "^1.1.0", "@japa/runner": "^2.2.2", "@japa/spec-reporter": "^1.3.3", - "@types/sinon": "^10.0.13", - "sinon": "^15.0.1" + "@types/sinon": "^10.0.15", + "sinon": "^15.1.0" }, "devDependencies": { "@athenna/common": "^4.2.0", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", "c8": "^5.0.2", - "commitizen": "^4.2.6", + "commitizen": "^4.3.0", "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "eslint": "^8.36.0", @@ -40,6 +40,15 @@ "typescript": "^5.0.2" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@apidevtools/json-schema-ref-parser": { "version": "9.0.9", "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", @@ -155,22 +164,22 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "optional": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true, "optional": true, "engines": { @@ -178,13 +187,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", - "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "optional": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -223,7 +232,7 @@ "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "optional": true, "engines": { @@ -233,7 +242,7 @@ "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "optional": true, "engines": { @@ -269,95 +278,108 @@ } }, "node_modules/@commitlint/config-validator": { - "version": "16.2.1", - "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-16.2.1.tgz", - "integrity": "sha512-hogSe0WGg7CKmp4IfNbdNES3Rq3UEI4XRPB8JL4EPgo/ORq5nrGTVzxJh78omibNuB8Ho4501Czb1Er1MoDWpw==", + "version": "17.4.4", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-17.4.4.tgz", + "integrity": "sha512-bi0+TstqMiqoBAQDvdEP4AFh0GaKyLFlPPEObgI29utoKEYoPQTvF0EYqIwYYLEoJYhj5GfMIhPHJkTJhagfeg==", "dev": true, "optional": true, "dependencies": { - "@commitlint/types": "^16.2.1", - "ajv": "^6.12.6" + "@commitlint/types": "^17.4.4", + "ajv": "^8.11.0" }, "engines": { - "node": ">=v12" + "node": ">=v14" } }, - "node_modules/@commitlint/execute-rule": { - "version": "16.2.1", - "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-16.2.1.tgz", - "integrity": "sha512-oSls82fmUTLM6cl5V3epdVo4gHhbmBFvCvQGHBRdQ50H/690Uq1Dyd7hXMuKITCIdcnr9umyDkr8r5C6HZDF3g==", + "node_modules/@commitlint/config-validator/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "optional": true, - "engines": { - "node": ">=v12" + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@commitlint/load": { - "version": "16.2.3", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-16.2.3.tgz", - "integrity": "sha512-Hb4OUlMnBUK6UxJEZ/VJ5k0LocIS7PtEMbRXEAA7eSpOgORIFexC4K/RaRpVd5UTtu3M0ST3ddPPijF9rdW6nw==", + "node_modules/@commitlint/config-validator/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true + }, + "node_modules/@commitlint/execute-rule": { + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-17.4.0.tgz", + "integrity": "sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA==", "dev": true, "optional": true, - "dependencies": { - "@commitlint/config-validator": "^16.2.1", - "@commitlint/execute-rule": "^16.2.1", - "@commitlint/resolve-extends": "^16.2.1", - "@commitlint/types": "^16.2.1", - "@types/node": ">=12", - "chalk": "^4.0.0", - "cosmiconfig": "^7.0.0", - "cosmiconfig-typescript-loader": "^1.0.0", - "lodash": "^4.17.19", - "resolve-from": "^5.0.0", - "typescript": "^4.4.3" - }, "engines": { - "node": ">=v12" + "node": ">=v14" } }, - "node_modules/@commitlint/load/node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "node_modules/@commitlint/load": { + "version": "17.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.5.0.tgz", + "integrity": "sha512-l+4W8Sx4CD5rYFsrhHH8HP01/8jEP7kKf33Xlx2Uk2out/UKoKPYMOIRcDH5ppT8UXLMV+x6Wm5osdRKKgaD1Q==", "dev": true, "optional": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "dependencies": { + "@commitlint/config-validator": "^17.4.4", + "@commitlint/execute-rule": "^17.4.0", + "@commitlint/resolve-extends": "^17.4.4", + "@commitlint/types": "^17.4.4", + "@types/node": "*", + "chalk": "^4.1.0", + "cosmiconfig": "^8.0.0", + "cosmiconfig-typescript-loader": "^4.0.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "lodash.uniq": "^4.5.0", + "resolve-from": "^5.0.0", + "ts-node": "^10.8.1", + "typescript": "^4.6.4 || ^5.0.0" }, "engines": { - "node": ">=4.2.0" + "node": ">=v14" } }, "node_modules/@commitlint/resolve-extends": { - "version": "16.2.1", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-16.2.1.tgz", - "integrity": "sha512-NbbCMPKTFf2J805kwfP9EO+vV+XvnaHRcBy6ud5dF35dxMsvdJqke54W3XazXF1ZAxC4a3LBy4i/GNVBAthsEg==", + "version": "17.4.4", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-17.4.4.tgz", + "integrity": "sha512-znXr1S0Rr8adInptHw0JeLgumS11lWbk5xAWFVno+HUFVN45875kUtqjrI6AppmD3JI+4s0uZlqqlkepjJd99A==", "dev": true, "optional": true, "dependencies": { - "@commitlint/config-validator": "^16.2.1", - "@commitlint/types": "^16.2.1", + "@commitlint/config-validator": "^17.4.4", + "@commitlint/types": "^17.4.4", "import-fresh": "^3.0.0", - "lodash": "^4.17.19", + "lodash.mergewith": "^4.6.2", "resolve-from": "^5.0.0", "resolve-global": "^1.0.0" }, "engines": { - "node": ">=v12" + "node": ">=v14" } }, "node_modules/@commitlint/types": { - "version": "16.2.1", - "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-16.2.1.tgz", - "integrity": "sha512-7/z7pA7BM0i8XvMSBynO7xsB3mVQPUZbVn6zMIlp/a091XJ3qAXRXc+HwLYhiIdzzS5fuxxNIHZMGHVD4HJxdA==", + "version": "17.4.4", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-17.4.4.tgz", + "integrity": "sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==", "dev": true, "optional": true, "dependencies": { - "chalk": "^4.0.0" + "chalk": "^4.1.0" }, "engines": { - "node": ">=v12" + "node": ">=v14" } }, "node_modules/@cspotcode/source-map-support": { @@ -616,14 +638,14 @@ } }, "node_modules/@japa/assert": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@japa/assert/-/assert-1.3.6.tgz", - "integrity": "sha512-aFyCRdLAgYR4P45CayMY7MlzHKLp+oKr2fGj34jObWqmNZOWgFJuEcwBGoqbr+ApL/9Qhkcq0hoFL2FyfFJ7Jw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@japa/assert/-/assert-1.4.1.tgz", + "integrity": "sha512-IyacnyaGzHqKTUbnOproPluHGWybt0ix0UsISAnjK62aTlDS4pOYPXkCDexk21/iReXNLtFgKM/RrDPDAUfrqA==", "dependencies": { - "@types/chai": "^4.3.3", + "@types/chai": "^4.3.4", "api-contract-validator": "^2.2.8", - "chai": "^4.3.6", - "macroable": "^7.0.1" + "chai": "^4.3.7", + "macroable": "^7.0.2" }, "peerDependencies": { "@japa/runner": "^2.1.1" @@ -725,18 +747,18 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.6.tgz", - "integrity": "sha512-R7xHtBSNm+9SyvpJkdQl+qrM3Hm2fea3Ef197M3mUug+v+yR+Rhfbs7PBtcBUVnIWJ4JcAdjvij+c8hXS9p5aw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -850,17 +872,25 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", - "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dependencies": { - "@sinonjs/commons": "^2.0.0" + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dependencies": { + "type-detect": "4.0.8" } }, "node_modules/@sinonjs/samsam": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-7.0.1.tgz", - "integrity": "sha512-zsAk2Jkiq89mhZovB2LLOdTCxJF4hqqTToGP0ASWlhp4I1hqOjcfmZGafXntCN7MDC6yySH0mFHrYtHceOeLmw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz", + "integrity": "sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==", "dependencies": { "@sinonjs/commons": "^2.0.0", "lodash.get": "^4.4.2", @@ -1000,13 +1030,6 @@ "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==", "dev": true }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true, - "optional": true - }, "node_modules/@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", @@ -1014,9 +1037,9 @@ "dev": true }, "node_modules/@types/sinon": { - "version": "10.0.13", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", - "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", + "version": "10.0.15", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.15.tgz", + "integrity": "sha512-3lrFNQG0Kr2LDzvjyjB6AMJk4ge+8iYhQfdnSwIwlG88FUOV43kPcQqDZkDa/h3WSZy6i8Fr0BSjfQtB1B3xuQ==", "dependencies": { "@types/sinonjs__fake-timers": "*" } @@ -2061,13 +2084,13 @@ } }, "node_modules/chai": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", + "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", - "deep-eql": "^3.0.1", + "deep-eql": "^4.1.2", "get-func-name": "^2.0.0", "loupe": "^2.3.1", "pathval": "^1.1.1", @@ -2129,7 +2152,7 @@ "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "engines": { "node": "*" } @@ -2166,9 +2189,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", - "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz", + "integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==", "dev": true, "engines": { "node": ">=6" @@ -2386,7 +2409,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/color-support": { @@ -2425,9 +2448,9 @@ } }, "node_modules/commitizen": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.2.6.tgz", - "integrity": "sha512-RyTM+EiD9GO01DJUn9MRRAet3XUHGfoUZoksLfr+1ym1Xt2q5EYJs9Fg2BtKSb5Mo53i0BtMBmWMHQXVlZ/L9w==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.0.tgz", + "integrity": "sha512-H0iNtClNEhT0fotHvGV3E9tDejDeS04sN1veIebsKYGMuGscFaswRoYJKmT3eW85eIJAs0F28bG2+a/9wCOfPw==", "dev": true, "dependencies": { "cachedir": "2.3.0", @@ -2438,10 +2461,10 @@ "find-root": "1.1.0", "fs-extra": "9.1.0", "glob": "7.2.3", - "inquirer": "8.2.4", + "inquirer": "8.2.5", "is-utf8": "^0.2.1", "lodash": "4.17.21", - "minimist": "1.2.6", + "minimist": "1.2.7", "strip-bom": "4.0.0", "strip-json-comments": "3.1.1" }, @@ -2454,12 +2477,6 @@ "node": ">= 12" } }, - "node_modules/commitizen/node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -2511,32 +2528,30 @@ } }, "node_modules/cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", "dev": true, "optional": true, "dependencies": { - "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "path-type": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" } }, "node_modules/cosmiconfig-typescript-loader": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-1.0.9.tgz", - "integrity": "sha512-tRuMRhxN4m1Y8hP9SNYfz7jRwt8lZdWxdjg/ohg5esKmsndJIn4yT96oJVcf5x0eA11taXl+sIp+ielu529k6g==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.3.0.tgz", + "integrity": "sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==", "dev": true, "optional": true, - "dependencies": { - "cosmiconfig": "^7", - "ts-node": "^10.7.0" - }, "engines": { "node": ">=12", "npm": ">=6" @@ -2544,9 +2559,29 @@ "peerDependencies": { "@types/node": "*", "cosmiconfig": ">=7", + "ts-node": ">=10", "typescript": ">=3" } }, + "node_modules/cosmiconfig/node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "optional": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -2642,7 +2677,7 @@ "node_modules/cz-conventional-changelog/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -2651,7 +2686,7 @@ "node_modules/cz-conventional-changelog/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -2746,18 +2781,18 @@ "node_modules/dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true }, "node_modules/deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dependencies": { "type-detect": "^4.0.0" }, "engines": { - "node": ">=0.12" + "node": ">=6" } }, "node_modules/deep-is": { @@ -2810,7 +2845,7 @@ "node_modules/detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3459,7 +3494,7 @@ "node_modules/expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", "dev": true, "dependencies": { "homedir-polyfill": "^1.0.1" @@ -3964,7 +3999,7 @@ "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "engines": { "node": "*" } @@ -4060,7 +4095,7 @@ "node_modules/global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "integrity": "sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==", "dev": true, "optional": true, "dependencies": { @@ -4087,7 +4122,7 @@ "node_modules/global-prefix": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", "dev": true, "dependencies": { "expand-tilde": "^2.0.2", @@ -4500,9 +4535,9 @@ "dev": true }, "node_modules/inquirer": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", - "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", "dev": true, "dependencies": { "ansi-escapes": "^4.2.1", @@ -4565,7 +4600,7 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "node_modules/is-bigint": { @@ -4872,7 +4907,7 @@ "node_modules/is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", "dev": true }, "node_modules/is-valid-path": { @@ -5386,19 +5421,6 @@ "node": ">=4" } }, - "node_modules/load-json-file/node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", - "dev": true, - "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/load-json-file/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -5443,10 +5465,17 @@ "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true, + "optional": true + }, "node_modules/lodash.map": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", - "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", + "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", "dev": true }, "node_modules/lodash.merge": { @@ -5454,11 +5483,25 @@ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true, + "optional": true + }, "node_modules/lodash.set": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" }, + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "dev": true, + "optional": true + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -5532,16 +5575,16 @@ "node_modules/longest": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", - "integrity": "sha1-eB4YMpaqlPbU2RbcM10NF676I/g=", + "integrity": "sha512-Ajzxb8CM6WAnFjgiloPsI3bF+WCxcvhdIG3KNA2KN962+tdBsHcuQ4k4qX/EcS/2CRkcc0iAkR956Nib6aXU/Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/loupe": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", "dependencies": { "get-func-name": "^2.0.0" } @@ -5916,17 +5959,17 @@ "integrity": "sha512-h8rADpW3k/wepLdERKF0VKMAPdoFYNQCLGPmc/f8sgQ2dxUy+7sY4WAX2XDUDjhKTjbJVbxxofLkzy7f1/tE4g==" }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -6048,28 +6091,22 @@ } }, "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, - "optional": true, "dependencies": { - "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" + "json-parse-better-errors": "^1.0.1" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -6624,9 +6661,9 @@ } }, "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { "inherits": "^2.0.3", @@ -6731,7 +6768,7 @@ "node_modules/resolve-dir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", "dev": true, "dependencies": { "expand-tilde": "^2.0.0", @@ -6955,6 +6992,26 @@ "tslib": "^2.1.0" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -7082,15 +7139,15 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/sinon": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.0.1.tgz", - "integrity": "sha512-PZXKc08f/wcA/BMRGBze2Wmw50CWPiAH3E21EOi4B49vJ616vW4DQh4fQrqsYox2aNR/N3kCqLuB0PwwOucQrg==", - "dependencies": { - "@sinonjs/commons": "^2.0.0", - "@sinonjs/fake-timers": "10.0.2", - "@sinonjs/samsam": "^7.0.1", - "diff": "^5.0.0", - "nise": "^5.1.2", + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.2.0.tgz", + "integrity": "sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==", + "dependencies": { + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^10.3.0", + "@sinonjs/samsam": "^8.0.0", + "diff": "^5.1.0", + "nise": "^5.1.4", "supports-color": "^7.2.0" }, "funding": { @@ -7098,6 +7155,14 @@ "url": "https://opencollective.com/sinon" } }, + "node_modules/sinon/node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dependencies": { + "type-detect": "4.0.8" + } + }, "node_modules/sinon/node_modules/diff": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", @@ -7234,26 +7299,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", diff --git a/package.json b/package.json index 983ef07..4647dfc 100644 --- a/package.json +++ b/package.json @@ -49,19 +49,19 @@ "#tests": "./tests/index.js" }, "dependencies": { - "@japa/assert": "^1.3.6", + "@japa/assert": "^1.4.1", "@japa/run-failed-tests": "^1.1.0", "@japa/runner": "^2.2.2", "@japa/spec-reporter": "^1.3.3", - "@types/sinon": "^10.0.13", - "sinon": "^15.0.1" + "@types/sinon": "^10.0.15", + "sinon": "^15.1.0" }, "devDependencies": { "@athenna/common": "^4.2.0", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", "c8": "^5.0.2", - "commitizen": "^4.2.6", + "commitizen": "^4.3.0", "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "eslint": "^8.36.0",