-
Notifications
You must be signed in to change notification settings - Fork 294
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
Adopt type=module #281
Adopt type=module #281
Conversation
follow changes in d3-format: * type=module * add exports * remove zip * license: ISC * update dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a suggestion, not an actual way of doing it, since I'm not 100% sure how to fix it completely.
The reason why some of the tests fail, is because the select-methods create a javascript function (correct me if I'm wrong) and then in the tests we are asserting a function with an object.
d3.select returns:
Selection {
_groups: [ [ HTMLHeadingElement {} ] ],
_parents: [ HTMLHtmlElement {} ]
}
Trying to deepStrictEqual-assert it against an object:
{
_groups: [ [ HTMLHeadingElement {} ] ],
_parents: [ HTMLHtmlElement {} ]
}
This will fail off course, while it would pass when using deepEqual
because its not strict
A more simple example:
function ex(msg) {
this._msg = msg;
}
const f = new ex('hello');
console.log(f); // -> f { _msg: 'hello' }
const object = { _msg: 'hello' };
console.log(object) // -> { _msg: 'hello' }
console.log(f === object) // -> false
The reason we get document is not defined
is because jsdom does not make a global.document
, we would need to do that ourselves, which I've added as a suggestion in the /tests/jsdom.js
file
Co-authored-by: Aulon Mujaj <aulon.mujaj@gmail.com>
Co-authored-by: Aulon Mujaj <aulon.mujaj@gmail.com>
Co-authored-by: Aulon Mujaj <aulon.mujaj@gmail.com>
some progress! thanks for the hints. We're down to 44 fails :) |
thank you, @aulonm! (cf. d3/d3-selection#281 (review))
* Adopt type=module follow changes in d3-format: * type=module * add exports * remove zip * license: ISC * update dependencies * all tests pass! thank you, @aulonm! (cf. d3/d3-selection#281 (review)) * browser rather than no-undef * update dependencies * add eslint.json * remove Sublime project * extract copyrights from license * cleaner tests * update README * update homepage Co-authored-by: Mike Bostock <mbostock@gmail.com>
follow changes in d3-format:
TODO: