basic snapshot test for tunes

This commit is contained in:
Felix Roos 2022-05-01 22:34:11 +02:00
parent 3eebccd566
commit 6cac8ba108
8 changed files with 9326 additions and 723 deletions

View file

@ -0,0 +1,14 @@
import { queryCode } from '../runtime.mjs';
import * as snaps from '../tunes.snapshot.mjs';
import * as tunes from '../tunes.mjs';
import { strict as assert } from 'assert';
describe('tunes', () => {
it('renders tunes correctly', async () => {
async function testTune(key) {
const haps = await queryCode(tunes[key], 1);
assert.deepStrictEqual(haps, snaps[key]);
}
await Promise.all(Object.keys(tunes).map(testTune));
});
});