Skip to content

Commit 6a6a9d5

Browse files
authored
Merge pull request #32 from konker/async-tests-fix
Async tests fix
2 parents abb76a6 + f2cd323 commit 6a6a9d5

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/modules/__tests__/task-either.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ const exampleTaskEitherL: ExampleTaskEither = TaskEither_.left(exampleLeft);
1515
const exampleTaskEitherR: ExampleTaskEither = TaskEither_.right(exampleRight);
1616

1717
describe('ruinTaskEither', () => {
18-
it('should return right', () => {
19-
expect(ruins.fromTaskEither(exampleTaskEitherR)).resolves.toEqual(exampleRight);
18+
it('should return right', async () => {
19+
await expect(ruins.fromTaskEither(exampleTaskEitherR)).resolves.toEqual(exampleRight);
2020
});
2121

22-
it('should throw left', () => {
23-
expect(ruins.fromTaskEither(exampleTaskEitherL)).rejects.toEqual(
22+
it('should throw left', async () => {
23+
await expect(ruins.fromTaskEither(exampleTaskEitherL)).rejects.toEqual(
2424
crashObject(exampleLeft),
2525
);
2626
});

src/modules/__tests__/task-option.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ const exampleTaskOptionN: ExampleTaskOption = TaskOption_.none;
1111
const exampleTaskOptionS: ExampleTaskOption = TaskOption_.some(example);
1212

1313
describe('ruinTaskOption', () => {
14-
it('should return value of some', () => {
15-
expect(ruins.fromTaskOption(exampleTaskOptionS)).resolves.toEqual(example);
14+
it('should return value of some', async () => {
15+
await expect(ruins.fromTaskOption(exampleTaskOptionS)).resolves.toEqual(example);
1616
});
1717

18-
it('should convert none to null', () => {
19-
expect(ruins.fromTaskOption(exampleTaskOptionN)).rejects.toEqual(null);
18+
it('should convert none to null', async () => {
19+
await expect(ruins.fromTaskOption(exampleTaskOptionN)).resolves.toEqual(null);
2020
});
2121
});

src/modules/__tests__/task-these.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const exampleTaskTheseR: ExampleTaskThese = TaskThese_.right(exampleRight);
1616
const exampleTaskTheseB: ExampleTaskThese = TaskThese_.both(exampleLeft, exampleRight);
1717

1818
describe('ruinTaskThese', () => {
19-
it('should return right', () => {
20-
expect(ruins.fromTaskThese(exampleTaskTheseR)).resolves.toEqual(exampleRight);
19+
it('should return right', async () => {
20+
await expect(ruins.fromTaskThese(exampleTaskTheseR)).resolves.toEqual(exampleRight);
2121
});
2222

23-
it('should throw left', () => {
24-
expect(ruins.fromTaskThese(exampleTaskTheseL)).rejects.toEqual(
23+
it('should throw left', async () => {
24+
await expect(ruins.fromTaskThese(exampleTaskTheseL)).rejects.toEqual(
2525
crashObject(exampleLeft),
2626
);
2727
});

src/modules/__tests__/task.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const exampleTask: Task<Answer> = async () => {
1616
};
1717

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

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

0 commit comments

Comments
 (0)