From bf4bf1a5959cd79a0c3523c2e62393701f434a71 Mon Sep 17 00:00:00 2001 From: Max Goodhart Date: Sat, 20 Jun 2020 20:50:32 -0700 Subject: [PATCH] Simplify test example syntax --- src/node/geometry.test.js | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/node/geometry.test.js b/src/node/geometry.test.js index d0b7fa9..42f9ae3 100644 --- a/src/node/geometry.test.js +++ b/src/node/geometry.test.js @@ -1,44 +1,39 @@ import { boxesFromViewURLMap } from './geometry' -const box1 = ` +function example([text]) { + return text + .replace(/\s/g, '') + .split('') + .map((c) => (c === '.' ? undefined : c)) +} + +const box1 = example` ab ab ` - .replace(/\s/g, '') - .split('') -const box2 = ` +const box2 = example` aa bb ` - .replace(/\s/g, '') - .split('') -const box3 = ` +const box3 = example` aac aaa dae ` - .replace(/\s/g, '') - .split('') -const box4 = ` +const box4 = example` ... .aa .aa ` - .replace(/\s/g, '') - .split('') - .map((c) => (c === '.' ? undefined : c)) -const box5 = ` +const box5 = example` ..a ..a .aa ` - .replace(/\s/g, '') - .split('') - .map((c) => (c === '.' ? undefined : c)) describe.each([ [