MCPcopy Create free account
hub / github.com/adobe/react-spectrum / softAssert

Function softAssert

scripts/lint-packages.js:26–33  ·  view source on GitHub ↗
(val, message)

Source from the content-addressed store, hash-verified

24// there's probably a nicer way to do this, but well... sometimes it's good enough. feel free to update me :)
25// maybe turn me into an actual eslint plugin so we get their format for styling
26function softAssert(val, message) {
27 try {
28 assert(val, message);
29 } catch {
30 console.error(chalk.red(message));
31 errors = true;
32 }
33}
34softAssert.deepEqual = function (val, val2, message) {
35 try {
36 assert.deepEqual(val, val2, message);

Callers 1

lint-packages.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected