better-assert
better-assert copied to clipboard
Improved fix for #12, extends pullreq #16: fix babel support issues
Works for babel 7. Augments #16, fixes #12.
See fork https://github.com/GerHobbelt/better-assert for npm test tests including babel transpiled runs.
The key problem was when using a modern import assert from ... statement in your code, which is then transpiled by babel, which replaces the assert(...) calls which something like (0, _.default)(...) when you transpile to ES5 or similar old targets, resulting in the /assert\(.../ line regex in better-assert to crash.
See also the pullreqqed code changes and commit message.