Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jul 8, 2019
1 parent 31d7f4f commit a8b6c2c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ METHODS.forEach(({ name, cartesian }) => {
ARGS.forEach(args => {
const title = prettyFormat(args, { min: true })
// eslint-disable-next-line max-nested-callbacks
test(`${name} ${title}`, t => {
test(`${name} | ${title}`, t => {
t.snapshot(cartesian(...args))
})
})
Expand All @@ -38,7 +38,7 @@ METHODS.forEach(({ name, cartesian }) => {
INVALID_ARGS.forEach(args => {
const title = prettyFormat(args, { min: true })
// eslint-disable-next-line max-nested-callbacks
test(`${name} ${title}`, t => {
test(`${name} | should throw: ${title}`, t => {
t.throws(cartesian.bind(null, ...args))
})
})
Expand Down
44 changes: 22 additions & 22 deletions test/snapshots/main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The actual snapshot is saved in `main.js.snap`.

Generated by [AVA](https://ava.li).

## array [[0, 1, 2], [3, 2]]
## array | [[0, 1, 2], [3, 2]]

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

## array [[0, 1], [2, 3]]
## array | [[0, 1], [2, 3]]

> Snapshot 1
Expand All @@ -58,7 +58,7 @@ Generated by [AVA](https://ava.li).
],
]

## array [[0, 1], [2]]
## array | [[0, 1], [2]]

> Snapshot 1
Expand All @@ -73,7 +73,7 @@ Generated by [AVA](https://ava.li).
],
]

## array [[0, 1]]
## array | [[0, 1]]

> Snapshot 1
Expand All @@ -86,7 +86,7 @@ Generated by [AVA](https://ava.li).
],
]

## array [[0, undefined, 1]]
## array | [[0, undefined, 1]]

> Snapshot 1
Expand All @@ -102,7 +102,7 @@ Generated by [AVA](https://ava.li).
],
]

## array [[0], [1]]
## array | [[0], [1]]

> Snapshot 1
Expand All @@ -113,7 +113,7 @@ Generated by [AVA](https://ava.li).
],
]

## array [[0]]
## array | [[0]]

> Snapshot 1
Expand All @@ -123,7 +123,7 @@ Generated by [AVA](https://ava.li).
],
]

## array [[[0]]]
## array | [[[0]]]

> Snapshot 1
Expand All @@ -135,25 +135,25 @@ Generated by [AVA](https://ava.li).
],
]

## array [[], []]
## array | [[], []]

> Snapshot 1
[]

## array [[]]
## array | [[]]

> Snapshot 1
[]

## array []
## array | []

> Snapshot 1
[]

## iterate [[0, 1, 2], [3, 2]]
## iterate | [[0, 1, 2], [3, 2]]

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

## iterate [[0, 1], [2, 3]]
## iterate | [[0, 1], [2, 3]]

> Snapshot 1
Expand All @@ -207,7 +207,7 @@ Generated by [AVA](https://ava.li).
],
]

## iterate [[0, 1], [2]]
## iterate | [[0, 1], [2]]

> Snapshot 1
Expand All @@ -222,7 +222,7 @@ Generated by [AVA](https://ava.li).
],
]

## iterate [[0, 1]]
## iterate | [[0, 1]]

> Snapshot 1
Expand All @@ -235,7 +235,7 @@ Generated by [AVA](https://ava.li).
],
]

## iterate [[0, undefined, 1]]
## iterate | [[0, undefined, 1]]

> Snapshot 1
Expand All @@ -251,7 +251,7 @@ Generated by [AVA](https://ava.li).
],
]

## iterate [[0], [1]]
## iterate | [[0], [1]]

> Snapshot 1
Expand All @@ -262,7 +262,7 @@ Generated by [AVA](https://ava.li).
],
]

## iterate [[0]]
## iterate | [[0]]

> Snapshot 1
Expand All @@ -272,7 +272,7 @@ Generated by [AVA](https://ava.li).
],
]

## iterate [[[0]]]
## iterate | [[[0]]]

> Snapshot 1
Expand All @@ -284,19 +284,19 @@ Generated by [AVA](https://ava.li).
],
]

## iterate [[], []]
## iterate | [[], []]

> Snapshot 1
[]

## iterate [[]]
## iterate | [[]]

> Snapshot 1
[]

## iterate []
## iterate | []

> Snapshot 1
Expand Down
Binary file modified test/snapshots/main.js.snap
Binary file not shown.

0 comments on commit a8b6c2c

Please sign in to comment.