handsontable / handsontable/hyperformula

Flaky tests: NOW() tests are failing on Safari

Open
#773 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Tests Verified
Dominant language
TypeScript
Stars
2.8k
Forks
171
Avg merge
1d 22h
Merged PRs (30d)
7

Description

Description
4424 specs, 2 failures, 4 pending specs

Interpreter - function NOW > works
Expected 31275.2399652778 to be close to 31275.1565856481.

Interpreter - function NOW > works #5
Expected 5 to equal 3.

We've used Date.parse as a date mock

https://github.com/handsontable/hyperformula/blob/413e199a632452bffb45f33c747b53a6f8af2cab/test/interpreter/function-now.spec.ts#L17-L20

As it turned out, Safari parses date differently than all other browsers.

  1. Don't use Date.parse
  2. Adding seconds with cnt++ will eventually run out of range for seconds and fail in every browsers
Steps to reproduce
  1. Run tests on Safari
Your environment
  • HyperFormula version: develop
  • Browser Name and version: Safari
  • Operating System: Mac OSX

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/interpreter/function-now.spec.ts, especially the referenced lines, and run the NOW function specs in Safari. Replace the Date.parse-based mock and avoid the seconds counter running out of range; done means the tests pass reliably in Safari and other browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.