Skip to content

Commit

Permalink
Fixed PhantomJS test cases for new elliptic library.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Nov 24, 2019
1 parent 3e3048d commit 4ac0843
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/shims.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions tests/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ function Reporter(runner) {
});
}

try {
window.ethersReporter = Reporter;
} catch (error) { }

module.exports = Reporter;
7 changes: 7 additions & 0 deletions tests/shims/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ if (!ArrayBuffer.isView) {
}
}

if (Array.prototype.fill == null) {
shims.push("Array.fill");
Array.prototype.fill = function(value) {
for (var i = 0; i < this.length; i++) { this[i] = value; }
}
}

// Shim nextTick
if (!global.nextTick) {
shims.push("nextTick");
Expand Down
2 changes: 1 addition & 1 deletion tests/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<!-- Run the test cases! -->
<script type="text/javascript">
mocha.reporter(tests.reporter);
mocha.reporter(ethersReporter);

// Use this to focus on specific test cases
//mocha.grep(new RegExp('easyseed')).run();
Expand Down
2 changes: 1 addition & 1 deletion tests/utils-ethers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var assert = require('assert');

function getEthers(filename) {
let ethers = require('../index');
var ethers = require('../index');
console.log('Loaded local ethers: ' + filename);
assert.equal(ethers.platform, 'node', 'platform: ' + ethers.platform + ' != "node"');
return ethers;
Expand Down

0 comments on commit 4ac0843

Please sign in to comment.