move tunes test to vitest
This commit is contained in:
parent
dc3a873abc
commit
22c60fb894
1 changed files with 8 additions and 10 deletions
|
|
@ -1,19 +1,17 @@
|
||||||
import { queryCode, testCycles } from '../runtime.mjs';
|
import { queryCode, testCycles } from '../runtime.mjs';
|
||||||
import * as snaps from '../tunes.snapshot.mjs';
|
import * as snaps from '../tunes.snapshot.mjs';
|
||||||
import * as tunes from '../tunes.mjs';
|
import * as tunes from '../tunes.mjs';
|
||||||
import { strict as assert } from 'assert';
|
import { describe, it, expect } from 'vitest';
|
||||||
// import { describe, it, expect } from 'vitest';
|
|
||||||
|
const tuneKeys = Object.keys(tunes);
|
||||||
|
|
||||||
async function testTune(key) {
|
async function testTune(key) {
|
||||||
// console.log('test tune', key);
|
|
||||||
const haps = await queryCode(tunes[key], testCycles[key] || 1);
|
const haps = await queryCode(tunes[key], testCycles[key] || 1);
|
||||||
assert.deepStrictEqual(haps, snaps[key]);
|
expect(haps).toEqual(snaps[key]);
|
||||||
// expect(haps).toEqual(snaps[key]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('renders tunes', () => {
|
describe.concurrent('renders tunes', () => {
|
||||||
Object.keys(tunes).forEach((key) => {
|
tuneKeys.slice(0, 40).forEach((key) => {
|
||||||
it(`tune: ${key}`, async () => {
|
it(`tune: ${key}`, async ({ expect }) => await testTune(key));
|
||||||
await testTune(key);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue