You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then include node_modules/better-assert-browser/better-assert-browser.js in your page. You could also copy and paste the code from this repo, nobody's watching.
Example
By default assertions are enabled, however setting window.NO_ASSERT to true will deactivate them.
try{console.log('before calling assert')assert('truthy')console.log('called assert')assert(window.someFoo==='bar')console.log('called with false')}catch(e){console.error('assert() failed:'+e.stack)}
This library/function is dependent upon the v8/chrome stacktrace api.
To get stacktraces for failed assertions, you need to check "Async" in the
right sidebar of the chrome devtools sources pane
This is because this function makes a request for the javascript file at the file url
indicated in the stack trace using window.fetch, which returns a promise, inside this we
throw an assertion error with the code asserted.
This library won't work unless your server responds to requests for individual files.
Contributing
hub clone devinrhode2/better-assert-browser # brew install hub if u kno foo
cd better-assert-browser
npm install -g live-server
live-server