CesiumGS / CesiumGS/cesium

Spying on CesiumMath is broken in tests

Open
#9,731 1 comment 0 reactions 0 assignees View on GitHub
test failure type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

Looks like the built tests have their own version of CesiumMath, this is most likely related to the global replacement we do for the Cesium instance. The end result is that something like:

```js
spyOn(CesiumMath, 'nextRandomNumber').and.returnValue(1234);
```

Will turn into a silent no-op and not affect the CesiumJS code actually calling Cesium.Math

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the CesiumMath spy example in the built tests, then trace how the global Cesium replacement provides CesiumMath to the test and to the CesiumJS code under test. Done means spying on CesiumMath.nextRandomNumber changes the value observed by the actual Cesium.Math caller.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.