You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
453 B
20 lines
453 B
2 years ago
|
import { wrapFunc, trueValue, falseValue } from "cumlisp";
|
||
|
import { AssertionError } from "assert"
|
||
|
import { exit } from "process"
|
||
|
|
||
|
export default {
|
||
|
assertTrue: wrapFunc("assertTrue", 2, (args) => {
|
||
|
if (!args[1]) {
|
||
|
/*throw new AssertionError({
|
||
|
message: `"${args[0]}" failed!`,
|
||
|
actual: args[1],
|
||
|
expected: trueValue
|
||
|
})*/
|
||
|
console.log(`"${args[0]}" failed!
|
||
|
Expected: '${trueValue}'
|
||
|
Recieved: '${args[1]}'`)
|
||
|
}
|
||
|
return args[1]
|
||
|
})
|
||
|
}
|