Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 29, 2019
1 parent d14ce64 commit c167847
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion test/helpers/error.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Make sure exceptions are snapshot as well
export const stringifyErrors = function(func) {
return addErrorHandler(func, String)
return addErrorHandler(func, error => error)
}

// Wrap a function with a error handler
Expand Down
58 changes: 32 additions & 26 deletions test/snapshots/main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,29 @@ Generated by [AVA](https://ava.li).
],
]

## [[0, 1], {}]

> Snapshot 1
[
[
0,
0,
],
[
0,
1,
],
[
1,
0,
],
[
1,
1,
],
]

## [[0, 1]]

> Snapshot 1
Expand Down Expand Up @@ -193,7 +216,9 @@ Generated by [AVA](https://ava.li).

> Snapshot 1
'TypeError: Argument must be iterable: true'
TypeError {
message: 'Argument must be iterable: true',
}

## [[]]

Expand All @@ -211,13 +236,17 @@ Generated by [AVA](https://ava.li).

> Snapshot 1
'TypeError: Argument must be iterable: null'
TypeError {
message: 'Argument must be iterable: null',
}

## [undefined]

> Snapshot 1
'TypeError: Argument must be iterable: undefined'
TypeError {
message: 'Argument must be iterable: undefined',
}

## [{}]

Expand All @@ -231,26 +260,3 @@ Generated by [AVA](https://ava.li).
1,
],
]

## [[0, 1], {}]

> Snapshot 1
[
[
0,
0,
],
[
0,
1,
],
[
1,
0,
],
[
1,
1,
],
]
Binary file modified test/snapshots/main.js.snap
Binary file not shown.

0 comments on commit c167847

Please sign in to comment.