Skip to content

Commit

Permalink
Merge pull request #32 from konker/async-tests-fix
Browse files Browse the repository at this point in the history
Async tests fix
  • Loading branch information
cyberixae authored Sep 16, 2022
2 parents abb76a6 + f2cd323 commit 6a6a9d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/modules/__tests__/task-either.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const exampleTaskEitherL: ExampleTaskEither = TaskEither_.left(exampleLeft);
const exampleTaskEitherR: ExampleTaskEither = TaskEither_.right(exampleRight);

describe('ruinTaskEither', () => {
it('should return right', () => {
expect(ruins.fromTaskEither(exampleTaskEitherR)).resolves.toEqual(exampleRight);
it('should return right', async () => {
await expect(ruins.fromTaskEither(exampleTaskEitherR)).resolves.toEqual(exampleRight);
});

it('should throw left', () => {
expect(ruins.fromTaskEither(exampleTaskEitherL)).rejects.toEqual(
it('should throw left', async () => {
await expect(ruins.fromTaskEither(exampleTaskEitherL)).rejects.toEqual(
crashObject(exampleLeft),
);
});
Expand Down
8 changes: 4 additions & 4 deletions src/modules/__tests__/task-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const exampleTaskOptionN: ExampleTaskOption = TaskOption_.none;
const exampleTaskOptionS: ExampleTaskOption = TaskOption_.some(example);

describe('ruinTaskOption', () => {
it('should return value of some', () => {
expect(ruins.fromTaskOption(exampleTaskOptionS)).resolves.toEqual(example);
it('should return value of some', async () => {
await expect(ruins.fromTaskOption(exampleTaskOptionS)).resolves.toEqual(example);
});

it('should convert none to null', () => {
expect(ruins.fromTaskOption(exampleTaskOptionN)).rejects.toEqual(null);
it('should convert none to null', async () => {
await expect(ruins.fromTaskOption(exampleTaskOptionN)).resolves.toEqual(null);
});
});
8 changes: 4 additions & 4 deletions src/modules/__tests__/task-these.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const exampleTaskTheseR: ExampleTaskThese = TaskThese_.right(exampleRight);
const exampleTaskTheseB: ExampleTaskThese = TaskThese_.both(exampleLeft, exampleRight);

describe('ruinTaskThese', () => {
it('should return right', () => {
expect(ruins.fromTaskThese(exampleTaskTheseR)).resolves.toEqual(exampleRight);
it('should return right', async () => {
await expect(ruins.fromTaskThese(exampleTaskTheseR)).resolves.toEqual(exampleRight);
});

it('should throw left', () => {
expect(ruins.fromTaskThese(exampleTaskTheseL)).rejects.toEqual(
it('should throw left', async () => {
await expect(ruins.fromTaskThese(exampleTaskTheseL)).rejects.toEqual(
crashObject(exampleLeft),
);
});
Expand Down
8 changes: 4 additions & 4 deletions src/modules/__tests__/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const exampleTask: Task<Answer> = async () => {
};

describe('ruinTask', () => {
it('should execute side effects', () => {
expect(ruins.fromTask(exampleTask).then(() => mutableState)).resolves.toEqual(true);
it('should execute side effects', async () => {
await expect(ruins.fromTask(exampleTask).then(() => mutableState)).resolves.toEqual(true);
});

it('should return computation return value', () => {
expect(ruins.fromTask(exampleTask)).resolves.toEqual(answer);
it('should return computation return value', async () => {
await expect(ruins.fromTask(exampleTask)).resolves.toEqual(answer);
});
});

0 comments on commit 6a6a9d5

Please sign in to comment.