From 235e82a348c76c6098496e06af15a713051572b4 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Tue, 9 Aug 2022 23:28:36 +0200 Subject: [PATCH] make tests a little bit faster --- package.json | 2 +- repl/src/test/tunes.test.mjs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 659014a1..58b3821d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "description": "Port of tidalcycles to javascript", "scripts": { - "test": "vitest run --reporter verbose -v --no-isolate", + "test": "vitest run --reporter verbose --isolate=false --silent --version", "bootstrap": "lerna bootstrap", "setup": "npm i && npm run bootstrap && cd repl && npm i && cd ../tutorial && npm i", "snapshot": "cd repl && npm run snapshot", diff --git a/repl/src/test/tunes.test.mjs b/repl/src/test/tunes.test.mjs index 82b8af01..8f10d8ff 100644 --- a/repl/src/test/tunes.test.mjs +++ b/repl/src/test/tunes.test.mjs @@ -1,17 +1,17 @@ import { queryCode, testCycles } from '../runtime.mjs'; import * as snaps from '../tunes.snapshot.mjs'; import * as tunes from '../tunes.mjs'; -import { describe, it, expect } from 'vitest'; +import { describe, it } from 'vitest'; const tuneKeys = Object.keys(tunes); -async function testTune(key) { +async function testTune(key, expect) { const haps = await queryCode(tunes[key], testCycles[key] || 1); expect(haps).toEqual(snaps[key]); } describe.concurrent('renders tunes', () => { - tuneKeys.slice(0, 40).forEach((key) => { - it(`tune: ${key}`, async ({ expect }) => await testTune(key)); + tuneKeys.forEach((key) => { + it(`tune: ${key}`, async ({ expect }) => await testTune(key, expect)); }); });