setup monorepo

This commit is contained in:
Robin Malfait
2020-09-16 18:19:33 +02:00
parent cf289e443a
commit 672afbe9f8
13 changed files with 11649 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
// Assuming requestAnimationFrame is roughly 60 frames per second
const frame = 1000 / 60
const formatter = new Intl.NumberFormat('en')
expect.extend({
toBeWithinRenderFrame(actual, expected) {
const min = expected - frame
const max = expected + frame
const pass = actual >= min && actual <= max
if (pass) {
return {
message: () =>
`expected ${actual} not to be within range of a frame ${formatter.format(
min
)} - ${formatter.format(max)}`,
pass: true,
}
} else {
return {
message: () =>
`expected ${actual} to be within range of a frame ${formatter.format(
min
)} - ${formatter.format(max)}`,
pass: false,
}
}
},
})