Skip to content
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

test fail: quantile(array, p) coerces values to numbers. #40

Closed
geekplux opened this issue Sep 12, 2016 · 2 comments
Closed

test fail: quantile(array, p) coerces values to numbers. #40

geekplux opened this issue Sep 12, 2016 · 2 comments

Comments

@geekplux
Copy link

geekplux commented Sep 12, 2016

run npm install after cloned this repo, a test fail occured:

# quantile(array, p) coerces values to numbers
ok 529 should be equal
ok 530 should be equal
ok 531 should be equal
ok 532 should be equal
not ok 533 should be equal
  ---
    operator: equal
    expected: 1309582800000
    actual:   1309579200000
    at: Test.<anonymous> (/Users/geekplux/Dropbox/project/github/d3-array/test/quantile-test.js:35:8)
  ...
ok 534 should be equal

is related to the time zone?   👀

I just fix it by changing:

  test.equal(arrays.quantile(dates, 1 / 2), +new Date(2011, 6, 2, 13));

to

  test.equal(arrays.quantile(dates, 1 / 2), +new Date(2011, 6, 2, 12));
@mbostock
Copy link
Member

Yes, the test was timezone-specific. I’ve changed it to use UTC dates.

@geekplux
Copy link
Author

so quickly response! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants