fix for-each test

This commit is contained in:
Clement Denis 2021-03-10 03:46:30 +01:00
parent 36cbfc51eb
commit 4cfb47e6c2
2 changed files with 5 additions and 7 deletions

View File

@ -29,10 +29,11 @@ const props = [String,Array]
.filter(p => typeof p.value === 'function')
const eq = (a, b) => {
const changed = props.filter(p => !p.src[p.key])
changed.forEach(p => p.src[p.key] = p.value)
const changed = []
for (const p of props) { !p.src[p.key] && (changed[changed.length] = p) }
for (const p of changed) { p.src[p.key] = p.value }
deepStrictEqual(a, b)
changed.forEach(p => p.src[p.key] = undefined)
for (const p of changed) { p.src[p.key] = undefined }
return true
}
@ -62,7 +63,7 @@ const readTest = filename =>
}))
const stackFmt = (err, url) => {
props.forEach(p => p.src[p.key] = p.value)
for (const p of props) { p.src[p.key] = p.value }
if (err instanceof Error) return err.stack.split(url).join(`${name}.js`)
throw Error(`Unexpected type thrown: ${typeof err}. usage: throw Error('my message')`)
}

View File

@ -1,3 +0,0 @@
FROM scratch
COPY . .