From a8b6c2c7c592f0b5c35194f68cd26bf87896d981 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Mon, 8 Jul 2019 10:00:00 +0200 Subject: [PATCH] Refactor tests --- test/main.js | 4 ++-- test/snapshots/main.js.md | 44 ++++++++++++++++++------------------ test/snapshots/main.js.snap | Bin 1070 -> 1069 bytes 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/main.js b/test/main.js index 7c49fc1..d7c47c4 100644 --- a/test/main.js +++ b/test/main.js @@ -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)) }) }) @@ -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)) }) }) diff --git a/test/snapshots/main.js.md b/test/snapshots/main.js.md index 9562b2e..8ce75bb 100644 --- a/test/snapshots/main.js.md +++ b/test/snapshots/main.js.md @@ -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 @@ -35,7 +35,7 @@ Generated by [AVA](https://ava.li). ], ] -## array [[0, 1], [2, 3]] +## array | [[0, 1], [2, 3]] > Snapshot 1 @@ -58,7 +58,7 @@ Generated by [AVA](https://ava.li). ], ] -## array [[0, 1], [2]] +## array | [[0, 1], [2]] > Snapshot 1 @@ -73,7 +73,7 @@ Generated by [AVA](https://ava.li). ], ] -## array [[0, 1]] +## array | [[0, 1]] > Snapshot 1 @@ -86,7 +86,7 @@ Generated by [AVA](https://ava.li). ], ] -## array [[0, undefined, 1]] +## array | [[0, undefined, 1]] > Snapshot 1 @@ -102,7 +102,7 @@ Generated by [AVA](https://ava.li). ], ] -## array [[0], [1]] +## array | [[0], [1]] > Snapshot 1 @@ -113,7 +113,7 @@ Generated by [AVA](https://ava.li). ], ] -## array [[0]] +## array | [[0]] > Snapshot 1 @@ -123,7 +123,7 @@ Generated by [AVA](https://ava.li). ], ] -## array [[[0]]] +## array | [[[0]]] > Snapshot 1 @@ -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 @@ -184,7 +184,7 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[0, 1], [2, 3]] +## iterate | [[0, 1], [2, 3]] > Snapshot 1 @@ -207,7 +207,7 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[0, 1], [2]] +## iterate | [[0, 1], [2]] > Snapshot 1 @@ -222,7 +222,7 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[0, 1]] +## iterate | [[0, 1]] > Snapshot 1 @@ -235,7 +235,7 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[0, undefined, 1]] +## iterate | [[0, undefined, 1]] > Snapshot 1 @@ -251,7 +251,7 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[0], [1]] +## iterate | [[0], [1]] > Snapshot 1 @@ -262,7 +262,7 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[0]] +## iterate | [[0]] > Snapshot 1 @@ -272,7 +272,7 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[[0]]] +## iterate | [[[0]]] > Snapshot 1 @@ -284,19 +284,19 @@ Generated by [AVA](https://ava.li). ], ] -## iterate [[], []] +## iterate | [[], []] > Snapshot 1 [] -## iterate [[]] +## iterate | [[]] > Snapshot 1 [] -## iterate [] +## iterate | [] > Snapshot 1 diff --git a/test/snapshots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