diff --git a/packages/tests/src.ts/test-hdnode.ts b/packages/tests/src.ts/test-hdnode.ts index dc72c905e..5d0b9bf9b 100644 --- a/packages/tests/src.ts/test-hdnode.ts +++ b/packages/tests/src.ts/test-hdnode.ts @@ -25,11 +25,15 @@ function checkRandom(name: string): boolean { return true; } +const isBrowser = (typeof(navigator) !== "undefined"); + describe('Test HD Node Derivation is Case Agnostic', function() { let tests: Array = loadTests('hdnode'); tests.forEach((test) => { if (!checkRandom(test.name)) { return; } + if (isBrowser && test.locale !== "en") { return; } + it("Normalizes case - " + test.name, function() { this.timeout(10000); let wordlist = (<{ [ locale: string ]: ethers.Wordlist }>(ethers.wordlists))[test.locale]; @@ -54,6 +58,8 @@ describe('Test HD Node Derivation from Seed', function() { // If there is nothing to derive, skip this portion of the test if (test.hdnodes.length === 0) { return; } + if (isBrowser && test.locale !== "en") { return; } + it('Derives the HD nodes - ' + test.name, function() { this.timeout(10000); @@ -79,6 +85,8 @@ describe('Test HD Node Derivation from Mnemonic', function() { tests.forEach((test) => { if (!checkRandom(test.name)) { return; } + if (isBrowser && test.locale !== "en") { return; } + // If there is nothing to derive, skip this portion of the test if (test.hdnodes.length === 0) { return; } @@ -114,6 +122,8 @@ describe('Test HD Mnemonic Phrases', function testMnemonic() { tests.forEach(function(test) { if (!checkRandom(test.name)) { return; } + if (isBrowser && test.locale !== "en") { return; } + it(('converts mnemonic phrases - ' + test.name), function() { this.timeout(1000000);