Conversation
|
Thank you! I released this as new major version 2.0.0. Can you confirm this is now working for you? -Antti |
|
Oh sorry, You need to run yarn add -D eastern assert-diff
# work!
node --experimental-modules test/index.mjs
# doesn't work...
node test/index.jsvar assert = require('assert-diff').default // Error: Cannot find module 'assert-diff'
assert.deepEqual({a: 1}, {a: 1}, 'this should not fail') |
|
Right, thanks! I have no idea of these new module exports or babel builds, so I'm very grateful for the help :) I got the tests working now with mocha which is familiar to me. I have to look at that eastern module a bit more to understand it. But now the build is published in v. 2.0.1. Is this working for you? |
|
I restored the old index.js on the side of the index.mjs as the new code broke the old behavior promised by this library i.e. it is a drop-in replacement for package 'assert'. So by default it should work the same as 'assert'. Now it won't work for e.g. assert(true), but you must use assert.default(true) etc. so it's not a drop-in replacement anymore. Do you have an idea how the module exports could work in the new system as before so assert(true) could work without having to use require('assert-diff').default ? |
|
Awesome, that works! 👍 |
Since I want to use your library from
.mjsorbabel, I use the one that adjusted the environment and released it as named-package@59naga/assert-diff.This can be used as follows for
.mjsorbabel..defaultis required as a disadvantage for commonjs.