Created
May 13, 2013 16:18
-
-
Save rik/5569538 to your computer and use it in GitHub Desktop.
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
require('/shared/js/l10n.js'); | |
//mocha.setup({globals: ['jsCount', 'totalResult']}); | |
suite('l10n', function(done) { | |
var _; | |
suiteSetup(function() { | |
_ = navigator.mozL10n.get; | |
var script = document.createElement('script'); | |
script.type = 'application/l10n'; | |
var foo = { | |
'locales': | |
{ | |
'en-US': | |
{ | |
'foo': {'textContent': 'foo-translated'} | |
} | |
} | |
}; | |
script.innerHTML = JSON.stringify(foo); | |
document.body.appendChild(script); | |
}); | |
suite('get', function() { | |
test('inexisting key', function() { | |
assert.strictEqual(_('bla'), ''); | |
}); | |
test('existing key', function() { | |
assert.strictEqual(_('foo'), 'foo-translated'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment