matrix-org / matrix-org/matrix-js-sdk

Fix the tests: Unhandled rejection Error: spy was never called

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

Nobody has claimed this yet.

Help Wanted T-Defect T-Other
Dominant language
TypeScript
Stars
2.2k
Forks
704
Avg merge
1d 20h
Merged PRs (30d)
40

Description

Aren't the tests broken even though travis shows it as passing or am I misunderstanding the travis logs for the recent pull requests?

https://travis-ci.org/matrix-org/matrix-js-sdk/builds/436211876#L8862
```
394 passing (11s)
13 pending
Saving device tracking data at token null
got keys for @test1:sw1v.org: {}
Completed key download for @test1:sw1v.org
Starting key download for [ '@test1:sw1v.org' ]
Another update in the queue for @test1:sw1v.org - not marking up-to-date
Creating new devicelist to simulate app reload
Unhandled rejection Error: spy was never called with [ [ '@test1:sw1v.org' ], {} ]
at assert (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/expect/lib/assert.js:29:9)
at Expectation.toHaveBeenCalledWith (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/expect/lib/Expectation.js:333:28)
at /home/travis/build/matrix-org/matrix-js-sdk/spec/unit/crypto/DeviceList.spec.js:138:33
at tryCatcher (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/promise.js:694:18)
at _drainQueueStep (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/travis/build/matrix-org/matrix-js-sdk/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:694:18)
at tryOnImmediate (timers.js:665:5)
at processImmediate (timers.js:647:5)
```

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 spec/unit/crypto/DeviceList.spec.js at line 138 and compare the failure in the linked Travis build with the test runner's reported result. Trace how the asynchronous assertion is handled and confirm the suite reports the failure correctly; done means the test outcome is no longer silently shown as passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.