New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unit test issues #53
Comments
Thanks for the report, I'm happy to hear to you want to contribute!
Could you please provide your execution log? Are the error not matching or are the error not thrown?
I basically have the same environment than Travis, could you provide some information about your environment?
Unfortunately I love Makefiles and don't like npm scripts 😄 (Babel is also using a Makefile). make MOCHA_OPTS="--inspect --debug-brk" test It will end up with |
Actually, my mistake, I spotted that you are using chai, which has a slightly different assert signature, where the string matches the (Having said that, the chai API docs are quite misleading and don't actually cover this case properly). Anyhow, I've done a bit more digging. The reason it is failing for me is due to the babel transform of the https://github.com/ColinEberhardt/js-webassembly-interpreter-issue-repro When this class is transformed, it adds a call to The wrapper that this adds prevents the I'd be interested to know whether your transpiled output includes
Ha ha, fair enough :-) My only concern with makefiles is they do make it a bit harder for Windows users. Although that's not a big deal. Thanks for the tip on arg passing. |
This looks like a similar issue to the one I am experiencing: And the addition of this plugin, as referenced in the issue, fixes it for me: https://www.npmjs.com/package/babel-plugin-transform-builtin-extend |
I don't have enough time right now but, I will fix the assertion for you later. The chai API is definitely mislead, I can try to clarify/replace it. Did you manage to pass the tests on your local machine?
Ah yes, that's actually a know issue that we have fix recently. babel/babel#7020 |
Aha ... that was the final clue I needed! I initially used yarn rather than npm to install dependencies, which ignored the repositories package-lock.json file. removing node_modules and re-installing via npm fixed the issue, the unit tests now pass :-) That was a bit of a long journey ;-) |
Good news. Btw we are already using the version of Babel that supports the native extend. |
At least something good came of this - I've updated the Chai docs to be clearer about the |
Nice! Thanks for the clarification. |
I've been digging into the code for this project, with a view to contributing. The first thing I did was clone and run the tests, unfortunately ~60 are failing for me - looks like all the tests that assert errors are thrown.
I've not quite got to the bottom of it, but have found a few issues:
assert.throws
should be a regex, not a string, as currently used in the tests. If you provide a string as the second argument, it will assert that an error is thrown, but not validate the message.Error
, additional logic is required in order to propagate themessage
property as detailed in this StackOverflow questionIt still doesn't explain why the tests fail for me but pass on Travis, however, I thought it was worth raising these.
One another note, do you have any objections to replacing your Makefile with npm run scripts? It is a more standard tooling for JS projects, and also allows you to do things like pass args to scripts, e.g.
This runs the tests with the debugger, allowing you to add breakpoints etc ...
The text was updated successfully, but these errors were encountered: