From c373c901a2abb51b83e8b9f4aa3c370c7500e84c Mon Sep 17 00:00:00 2001 From: bumi Date: Mon, 9 Apr 2018 20:54:07 +0200 Subject: [PATCH] Fix test to work with the bignumber depencency --- tests/unit/controllers/index-test.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/unit/controllers/index-test.js b/tests/unit/controllers/index-test.js index a0bdd28..0bce69e 100644 --- a/tests/unit/controllers/index-test.js +++ b/tests/unit/controllers/index-test.js @@ -18,11 +18,14 @@ let addFixtures = function(controller) { }); [ - { github_username: "neo", github_uid: "318", balance: "10000" }, - { github_username: "morpheus", github_uid: "843", balance: "15000" }, - { github_username: "trinity", github_uid: "123", balance: "5000" }, - { github_username: "mouse", github_uid: "696", balance: "0" } + { github_username: "neo", github_uid: "318", balance: 10000 }, + { github_username: "morpheus", github_uid: "843", balance: 15000 }, + { github_username: "trinity", github_uid: "123", balance: 5000 }, + { github_username: "mouse", github_uid: "696", balance: 0 } ].forEach(fixture => { + // we expect a bignumer but I don't want to add the bignumber dependency here... so this is some hack to return an object that looks good enough for the test + let fakeBignumber = function(balance) { return { toNumber: function() { return balance; } }; }; + fixture.balance = fakeBignumber(fixture.balance); controller.get('model.contributors').push(Contributor.create(fixture)); }); };