Skip to content

Commit

Permalink
ssr-tests: add better error messsages
Browse files Browse the repository at this point in the history
Previously the error object was used to generate a new error object which
had the effect of removing the stack trace from the actual error. This
made debugging SSR test failures very difficult. Now we just propagate
the original error.
  • Loading branch information
spmonahan committed Oct 28, 2022
1 parent 4ed67bd commit f826e61
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/ssr-tests/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ describe('Utilities', () => {
assert.equal(library.getDocument(), undefined);
});
});

describe('canUseDOM', () => {
it('returns false in server environment', () => {
assert.equal(library.canUseDOM(), false);
});
});
});

function testRender(componentName, component) {
Expand All @@ -56,7 +62,7 @@ function testRender(componentName, component) {
ReactDOMServer.renderToString(elem);
done();
} catch (e) {
done(new Error(e));
done(e);
}
});
}

0 comments on commit f826e61

Please sign in to comment.