-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds YAML to dev dependencies and improves README and test changes pe…
…r review comment
- Loading branch information
1 parent
b262d7d
commit e756994
Showing
4 changed files
with
24 additions
and
13 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,23 +1,22 @@ | ||
const i18n = require('..') | ||
const should = require('should') | ||
const { I18n } = require('..') | ||
const YAML = require('yaml') | ||
require('should') | ||
|
||
describe('configure parser', function () { | ||
context('with YAML parser', () => { | ||
i18n.configure({ | ||
context('with YAML parser', function () { | ||
const i18n = new I18n({ | ||
locales: ['en', 'de'], | ||
parser: YAML | ||
}) | ||
|
||
it('should parse the locale files with the YAML parser', function () { | ||
should.equal(i18n.__('Hello'), 'Hello') | ||
i18n.__('Hello').should.equal('Hello') | ||
}) | ||
|
||
it('should write unknown keys to the catalog', function () { | ||
i18n.__('does.not.exist') | ||
|
||
var catalog = i18n.getCatalog() | ||
catalog.should.have.property('does.not.exist', 'does.not.exist') | ||
i18n.getCatalog().should.have.property('does.not.exist', 'does.not.exist') | ||
}) | ||
}) | ||
}) |