diff --git a/tests/browser.js b/tests/browser.js
index 3360f80a2..42b6b462c 100644
--- a/tests/browser.js
+++ b/tests/browser.js
@@ -8,4 +8,5 @@ module.exports = {
providers: require('./test-providers'),
utils: require('./test-utils'),
wallet: require('./test-wallet'),
+ wordlists: require('./test-wordlists'),
}
diff --git a/tests/test-wordlists.js b/tests/test-wordlists.js
new file mode 100644
index 000000000..83ead9b27
--- /dev/null
+++ b/tests/test-wordlists.js
@@ -0,0 +1,33 @@
+'use strict';
+
+var assert = require('assert');
+
+var utils = require('./utils');
+
+if (global.ethers) {
+ console.log('Using global ethers; ' + __filename);
+ var ethers = global.ethers;
+} else {
+ var ethers = require('..');
+}
+
+function checkWordlist(filename, wordlist) {
+ var words = utils.loadText(filename).split('\n');
+ it('matches wordlists for ' + wordlist.locale, function() {
+ for (var i = 0; i < 2048; i++) {
+ var actual = wordlist.getWord(i);
+ var expected = words[i];
+ assert.equal(actual, expected, 'failed to match word ' + i + ': ' + words[i] + ' !=' + wordlist.getWord(i));
+ }
+ });
+}
+
+describe('Check Wordlists', function() {
+ checkWordlist('./wordlist-generation/lang-en.txt', ethers.wordlists.en);
+ checkWordlist('./wordlist-generation/lang-it.txt', ethers.wordlists.it);
+ checkWordlist('./wordlist-generation/lang-ja.txt', ethers.wordlists.ja);
+ checkWordlist('./wordlist-generation/lang-ko.txt', ethers.wordlists.ko);
+ checkWordlist('./wordlist-generation/lang-zh_cn.txt', ethers.wordlists.zh);
+ checkWordlist('./wordlist-generation/lang-zh_cn.txt', ethers.wordlists.zh_cn);
+ checkWordlist('./wordlist-generation/lang-zh_tw.txt', ethers.wordlists.zh_tw);
+});
diff --git a/tests/test.html b/tests/test.html
index 8380ee471..8fcfd5524 100644
--- a/tests/test.html
+++ b/tests/test.html
@@ -54,6 +54,10 @@
+
+
+
+
@@ -61,7 +65,7 @@