Skip to content

Commit

Permalink
Removed non-english tests from the browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Oct 17, 2021
1 parent 2f363da commit 91c577b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/tests/src.ts/test-hdnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TestCase.HDWallet> = 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];
Expand All @@ -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);

Expand All @@ -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; }

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 91c577b

Please sign in to comment.