use vitest snapshot feature for tunes
This commit is contained in:
parent
c1255bfa88
commit
f955d77d71
4 changed files with 20682 additions and 58 deletions
20676
repl/src/test/__snapshots__/tunes.test.mjs.snap
Normal file
20676
repl/src/test/__snapshots__/tunes.test.mjs.snap
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,17 +1,14 @@
|
|||
import { queryCode, testCycles } from '../runtime.mjs';
|
||||
import * as snaps from '../tunes.snapshot.mjs';
|
||||
import * as tunes from '../tunes.mjs';
|
||||
import { describe, it } from 'vitest';
|
||||
|
||||
const tuneKeys = Object.keys(tunes);
|
||||
|
||||
async function testTune(key, expect) {
|
||||
const haps = await queryCode(tunes[key], testCycles[key] || 1);
|
||||
expect(haps).toEqual(snaps[key]);
|
||||
}
|
||||
|
||||
describe.concurrent('renders tunes', () => {
|
||||
describe('renders tunes', () => {
|
||||
tuneKeys.forEach((key) => {
|
||||
it(`tune: ${key}`, async ({ expect }) => await testTune(key, expect));
|
||||
it(`tune: ${key}`, async ({ expect }) => {
|
||||
const haps = await queryCode(tunes[key], testCycles[key] || 1);
|
||||
expect(haps).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue