-
Notifications
You must be signed in to change notification settings - Fork 197
HARP-12868: Fix Tile and TileGeometryLoader tests #1963
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1963 +/- ##
==========================================
- Coverage 65.94% 65.94% -0.01%
==========================================
Files 293 293
Lines 26224 26224
Branches 5923 5923
==========================================
- Hits 17294 17293 -1
- Misses 8930 8931 +1
Continue to review full report at Codecov.
|
expect(spyCreateGeometries.callCount).equal(1); | ||
expect(geometryLoader.isFinished).to.be.true; | ||
}); | ||
geometryLoader.waitFinished().should.be.fulfilled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should await
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
@@ -230,14 +224,14 @@ describe("TileGeometryLoader", function() { | |||
|
|||
expect(mapView.taskQueue.processNext(TileTaskGroups.CREATE)).equal(true); | |||
|
|||
geometryLoader.waitFinished().should.be.rejected.then(() => { | |||
return geometryLoader.waitFinished().should.be.rejected.then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file mixes returning a promise & async / await, please choose one way and keep it consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
expect(mapView.taskQueue.numItemsLeft(TileTaskGroups.CREATE)).equal(1); | ||
expect(mapView.taskQueue.processNext(TileTaskGroups.CREATE)).equal(true); | ||
expect(spyProcessTechniques.callCount).equal(1); | ||
expect(spyCreateGeometries.callCount).equal(0, "should not create geometry"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debugged this and they are incremented after the geometryLoader!.update();
call, so they should be put up there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
@@ -22,6 +23,20 @@ describe("WebTileDataSource", function() { | |||
projection: mercatorProjection | |||
} as MapView; | |||
|
|||
let loggerWasEnabled = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is quite a bit of code to remove the error logging, can it be done in a different way?
Also, it seems that at least in the WebTileTest.ts there is only a single test which causes this. So I think it makes sense to put this code just there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the test in question. I don't know how to simplify it, let me know if you think of something.
We have to leave the logging system in its original state after the affected state to avoid affecting other tests. We have some tests that even capture logs and make assertions on them (quite nasty if you ask me).
Failing tests weren't either returning a promise or calling done() callback, therefore error was not reported by mocha.
4b39b01
to
baf0547
Compare
Thank you for contributing to harp.gl!
Before requesting a pull request, please remember to check the following documents:
If you are adding new functionality we would highly appreciate if you can describe what is the capability you are adding and even better if you can add some examples. Please also remember to add tests for it.
CI Check
Our bots will check whether your PR can be directly integrated into the mainline. We have some internal integration tests running on the background, our bots will inform you of the next steps and someone from our team will take a look and help if needed!
And please do not forget to sign-off your commit! You can read more about DCO here. But, in short, you just need to use
git commit -s
or append--signoff
when you are committing to the repo.Happy contributing!