diff --git a/src/validators/TestValidator.ts b/src/validators/TestValidator.ts deleted file mode 100644 index f0f1558..0000000 --- a/src/validators/TestValidator.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Context } from '@athenna/http' -import { Validator, BaseValidator } from '@athenna/validator' - -@Validator() -export class TestValidator extends BaseValidator { - public schema = this.validator.object({ - name: this.validator.string() - }) - - public async handle({ request }: Context) { - const data = request.body - - await this.validate(data) - } -} diff --git a/tests/helpers/BaseCommandTest.ts b/tests/helpers/BaseCommandTest.ts index d6b1b3c..8a2c078 100644 --- a/tests/helpers/BaseCommandTest.ts +++ b/tests/helpers/BaseCommandTest.ts @@ -24,6 +24,7 @@ export class BaseCommandTest { @AfterEach() public async afterEach() { + await Folder.safeRemove(Path.validators()) await Folder.safeRemove(Path.fixtures('storage')) await new File(Path.pwd('package.json')).setContent(this.originalPackageJson) diff --git a/tests/unit/commands/MakeValidatorCommandTest.ts b/tests/unit/commands/MakeValidatorCommandTest.ts index 1462786..aafe5bd 100644 --- a/tests/unit/commands/MakeValidatorCommandTest.ts +++ b/tests/unit/commands/MakeValidatorCommandTest.ts @@ -16,6 +16,8 @@ export default class MakeValidatorCommandTest extends BaseCommandTest { public async shouldBeAbleToCreateAValidatorFile({ assert, command }: Context) { const output = await command.run('make:validator TestValidator') + console.log(output.output) + output.assertSucceeded() output.assertLogged('[ MAKING VALIDATOR ]') output.assertLogged('[ success ] Validator "TestValidator" successfully created.')