mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 13:38:40 +00:00
fix: bring back examples test
+ ignore device motion examples
This commit is contained in:
parent
5cef1a8cf9
commit
75f5f45652
36
test/examples.test.mjs
Normal file
36
test/examples.test.mjs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { queryCode } from './runtime.mjs';
|
||||||
|
import { describe, it } from 'vitest';
|
||||||
|
import doc from '../doc.json';
|
||||||
|
|
||||||
|
const skippedExamples = [
|
||||||
|
'absoluteOrientationGamma',
|
||||||
|
'absoluteOrientationBeta',
|
||||||
|
'absoluteOrientationAlpha',
|
||||||
|
'orientationGamma',
|
||||||
|
'orientationBeta',
|
||||||
|
'orientationAlpha',
|
||||||
|
'rotationGamma',
|
||||||
|
'rotationBeta',
|
||||||
|
'rotationAlpha',
|
||||||
|
'gravityZ',
|
||||||
|
'gravityY',
|
||||||
|
'gravityX',
|
||||||
|
'accelerationZ',
|
||||||
|
'accelerationY',
|
||||||
|
'accelerationX',
|
||||||
|
];
|
||||||
|
|
||||||
|
describe('runs examples', () => {
|
||||||
|
const { docs } = doc;
|
||||||
|
docs.forEach(async (doc) => {
|
||||||
|
if (skippedExamples.includes(doc.name)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
doc.examples?.forEach((example, i) => {
|
||||||
|
it(`example "${doc.name}" example index ${i}`, async ({ expect }) => {
|
||||||
|
const haps = await queryCode(example, 4);
|
||||||
|
expect(haps).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user