testcase = {
const withMessage = (title, color) =>
html`<div style="font: var(--mono_fonts); color: ${color}; padding: 6px 0;">${title}</div>`
const test = (...args) => {
const [fixture, title] = args.reverse()
const actual = fixture.test ? fixture.test(fixture.input) : fixture.input
const expected = fixture.output
expect(actual).toEqual(expected)
return withMessage(`Success: ${title || "test passed"}`, "green")
}
test.skip = (...args) => {
const [fixture, title] = args.reverse()
return withMessage(`Skipped: ${title || "test skipped"}`, "darkorange")
}
return test
}