Conversation
follow changes in d3-format: * type=module * add exports * remove zip * license: ISC * update dependencies
There was a problem hiding this comment.
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 <[email protected]>
Co-authored-by: Aulon Mujaj <[email protected]>
Co-authored-by: Aulon Mujaj <[email protected]>
|
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 <[email protected]>
follow changes in d3-format:
TODO: