jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/404744 )
Change subject: Hygiene: fix api-util-test
......................................................................
Hygiene: fix api-util-test
Should not have reused the list between tests.
Bug: T182738
Change-Id: I1736624e52e00b1e0279fe1ddf1733f978e479f3
---
M test/lib/api-util/api-util-test.js
1 file changed, 2 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Jdlrobson: Looks good to me, approved
diff --git a/test/lib/api-util/api-util-test.js
b/test/lib/api-util/api-util-test.js
index 5059c18..3e22755 100644
--- a/test/lib/api-util/api-util-test.js
+++ b/test/lib/api-util/api-util-test.js
@@ -12,8 +12,6 @@
logger.log = function(a, b) {};
-const list = [0, 1, 2, 3, 4];
-
describe('lib:apiUtil', () => {
it('checkForQueryPagesInResponse should return 504 when query.pages are
absent', () => {
@@ -27,7 +25,7 @@
});
it('batching works correctly', () => {
- const batches = api._batch(list, 2);
+ const batches = api._batch([0, 1, 2, 3, 4], 2);
assert.deepEqual(batches.length, 3);
assert.deepEqual(batches[0].length, 2);
assert.deepEqual(batches[1].length, 2);
@@ -35,7 +33,7 @@
});
it('order is preserved when Array.reduce is called on resolved
BBPromise.all batches', () => {
- const batches = api._batch(list, 2);
+ const batches = api._batch([0, 1, 2, 3, 4], 2);
const promises = BBPromise.all(batches.map((batch) => {
return new BBPromise(resolve => setTimeout(() => resolve(batch),
batch.length * 10));
}));
--
To view, visit https://gerrit.wikimedia.org/r/404744
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1736624e52e00b1e0279fe1ddf1733f978e479f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND <[email protected]>
Gerrit-Reviewer: Fjalapeno <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Mhurd <[email protected]>
Gerrit-Reviewer: Ppchelko <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits