Testing RedwoodJS
https://redwoodjs.com/docs/testing
by Rob Cameron
JavaScript
const add = (a, b) => {
return a + b
}
if (add(1, 1) === 2) {
document.write('pass')
} else {
document.write('fail')
}
try {
document.write(add(1))
} catch (e) {
if (e.message === 'add() requires two arguments') {
document.write('pass')
} else {
document.write('fail')
}
}