Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmtsen committed Nov 15, 2023
1 parent c4c40e3 commit 4d07b2a
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions src/lib/failure.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import test from "ava";
import test from 'ava';

import { Failure } from "./failure";
import { FailureType } from "./failure-type";
import { Failure } from './failure';
import { FailureType } from './failure-type';

const code = "FAILURE_CODE";
const description = "FAILURE_DESCRIPTION";
const code = 'FAILURE_CODE';
const description = 'FAILURE_DESCRIPTION';

test("failure", (t) => {
test('failure', (t) => {
const failure = Failure.create(code, description);

t.is(failure.code, code);
Expand All @@ -15,7 +15,7 @@ test("failure", (t) => {
t.is(failure.numericType, FailureType.Default.valueOf());
});

test("failure with type unexpected", (t) => {
test('failure with type unexpected', (t) => {
const unexpectedFailure = Failure.unexpected(code, description);

t.is(unexpectedFailure.code, code);
Expand All @@ -24,7 +24,7 @@ test("failure with type unexpected", (t) => {
t.is(unexpectedFailure.numericType, FailureType.Unexpected.valueOf());
});

test("failure with type validation", (t) => {
test('failure with type validation', (t) => {
const validationFailure = Failure.validation(code, description);

t.is(validationFailure.code, code);
Expand All @@ -33,7 +33,7 @@ test("failure with type validation", (t) => {
t.is(validationFailure.numericType, FailureType.Validation.valueOf());
});

test("failure with type conflict", (t) => {
test('failure with type conflict', (t) => {
const conflictFailure = Failure.conflict(code, description);

t.is(conflictFailure.code, code);
Expand All @@ -42,7 +42,7 @@ test("failure with type conflict", (t) => {
t.is(conflictFailure.numericType, FailureType.Conflict.valueOf());
});

test("failure with type not found", (t) => {
test('failure with type not found', (t) => {
const notFoundFailure = Failure.notFound(code, description);

t.is(notFoundFailure.code, code);
Expand All @@ -51,7 +51,7 @@ test("failure with type not found", (t) => {
t.is(notFoundFailure.numericType, FailureType.NotFound.valueOf());
});

test("failure with type unauthorized", (t) => {
test('failure with type unauthorized', (t) => {
const unauthorizedFailure = Failure.unauthorized(code, description);

t.is(unauthorizedFailure.code, code);
Expand All @@ -60,7 +60,7 @@ test("failure with type unauthorized", (t) => {
t.is(unauthorizedFailure.numericType, FailureType.Unauthorized.valueOf());
});

test("failure with custom type", (t) => {
test('failure with custom type', (t) => {
const customType = 1234;
const customFailure = Failure.custom(code, description, customType);

Expand All @@ -70,8 +70,8 @@ test("failure with custom type", (t) => {
t.is(customFailure.numericType, customType);
});

test("failure from error", (t) => {
const error = new Error("ERROR_MESSAGE");
test('failure from error', (t) => {
const error = new Error('ERROR_MESSAGE');
const failure = Failure.fromError(error);

t.is(failure.code, error.name);
Expand All @@ -80,55 +80,55 @@ test("failure from error", (t) => {
t.is(failure.numericType, FailureType.Unexpected.valueOf());
});

test("failure with default parameters", (t) => {
test('failure with default parameters', (t) => {
const failure = Failure.create();

t.is(failure.code, "General.Failure");
t.is(failure.description, "A failure has occurred.");
t.is(failure.code, 'General.Failure');
t.is(failure.description, 'A failure has occurred.');
t.is(failure.type, FailureType.Default);
t.is(failure.numericType, FailureType.Default.valueOf());
});

test("failure with type unexpected and default parameters", (t) => {
test('failure with type unexpected and default parameters', (t) => {
const failure = Failure.unexpected();

t.is(failure.code, "General.Unexpected");
t.is(failure.description, "An unexpected failure has occurred.");
t.is(failure.code, 'General.Unexpected');
t.is(failure.description, 'An unexpected failure has occurred.');
t.is(failure.type, FailureType.Unexpected);
t.is(failure.numericType, FailureType.Unexpected.valueOf());
});

test("failure with type validation and default parameters", (t) => {
test('failure with type validation and default parameters', (t) => {
const failure = Failure.validation();

t.is(failure.code, "General.Validation");
t.is(failure.description, "A validation failure has occurred.");
t.is(failure.code, 'General.Validation');
t.is(failure.description, 'A validation failure has occurred.');
t.is(failure.type, FailureType.Validation);
t.is(failure.numericType, FailureType.Validation.valueOf());
});

test("failure with type conflict and default parameters", (t) => {
test('failure with type conflict and default parameters', (t) => {
const failure = Failure.conflict();

t.is(failure.code, "General.Conflict");
t.is(failure.description, "A conflict has occurred.");
t.is(failure.code, 'General.Conflict');
t.is(failure.description, 'A conflict has occurred.');
t.is(failure.type, FailureType.Conflict);
t.is(failure.numericType, FailureType.Conflict.valueOf());
});

test("failure with type not found and default parameters", (t) => {
test('failure with type not found and default parameters', (t) => {
const failure = Failure.notFound();

t.is(failure.code, "General.NotFound");
t.is(failure.code, 'General.NotFound');
t.is(failure.description, "A 'Not Found' failure has occurred.");
t.is(failure.type, FailureType.NotFound);
t.is(failure.numericType, FailureType.NotFound.valueOf());
});

test("failure with type unauthorized and default parameters", (t) => {
test('failure with type unauthorized and default parameters', (t) => {
const failure = Failure.unauthorized();

t.is(failure.code, "General.Unauthorized");
t.is(failure.code, 'General.Unauthorized');
t.is(failure.description, "An 'Unauthorized' failure has occurred.");
t.is(failure.type, FailureType.Unauthorized);
t.is(failure.numericType, FailureType.Unauthorized.valueOf());
Expand Down

0 comments on commit 4d07b2a

Please sign in to comment.