mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 13:48:34 +00:00
make tests a little bit faster
This commit is contained in:
parent
17d0b7d291
commit
235e82a348
@ -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",
|
||||
|
||||
@ -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));
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user