Commit be8e2c95 authored by Benjamin Bouvier's avatar Benjamin Bouvier
Browse files

Make assertions fatal errors in testing;

parent 715f0d94
......@@ -49,6 +49,10 @@ export function debug(...args) {
export function assert(x, wat) {
if (!x) {
let text = `Assertion error: ${wat ? wat : ''}\n${new Error().stack}`;
if (process.env.NODE_ENV === 'test') {
// During testing, errors should be fatal.
throw new Error(text);
}
if (ASSERTS) {
window.alert(text);
console.error(text);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment