-
Notifications
You must be signed in to change notification settings - Fork 783
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: ensure locale files are valid (#1673)
* test: test that locale files are valid * relative paths from file * build before testing * make sync
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var assert = require('assert'); | ||
var glob = require('glob'); | ||
var axe = require(path.join(__dirname, '../axe')); | ||
|
||
var localeFiles = glob.sync(path.join(__dirname, '../locales/*.json')); | ||
|
||
describe('locales', function() { | ||
localeFiles.forEach(function(localeFile) { | ||
var localeName = path.basename(localeFile); | ||
it(localeName + ' should be valid', function() { | ||
var localeData = fs.readFileSync(localeFile, 'utf-8'); | ||
var locale = JSON.parse(localeData); | ||
function fn() { | ||
axe.configure({ locale: locale }); | ||
} | ||
|
||
assert.doesNotThrow(fn); | ||
}); | ||
}); | ||
}); |