test all in source examples
This commit is contained in:
parent
1a6743dba9
commit
e9544f8f92
6 changed files with 3224 additions and 3 deletions
3197
tutorial/test/__snapshots__/examples.test.mjs.snap
Normal file
3197
tutorial/test/__snapshots__/examples.test.mjs.snap
Normal file
File diff suppressed because it is too large
Load diff
15
tutorial/test/examples.test.mjs
Normal file
15
tutorial/test/examples.test.mjs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { queryCode } from '../../repl/src/runtime.mjs';
|
||||
import { describe, it } from 'vitest';
|
||||
import doc from '../../doc.json';
|
||||
|
||||
describe('runs examples', () => {
|
||||
const { docs } = doc;
|
||||
docs.forEach(async (doc) => {
|
||||
doc.examples?.forEach((example, i) => {
|
||||
it(`example "${doc.name}" example index ${i}`, async ({ expect }) => {
|
||||
const haps = await queryCode(example, 4);
|
||||
expect(haps).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue