-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added missing unit test file
- Loading branch information
alex-dow
committed
Nov 11, 2015
1 parent
c8a605c
commit feb0304
Showing
1 changed file
with
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* icu-converter | ||
* https://github.com/alex-dow/icu-converter | ||
* | ||
* Copyright (c) 2015 Alex Dowgailenko | ||
* Licensed under the MIT License | ||
* https://github.com/alex-dow/icu-converter/blob/master/LICENSE | ||
*/ | ||
|
||
describe("Converter", function() { | ||
|
||
var ICUConverter = require('../../src/icu-converter'); | ||
var fs = require('fs'); | ||
var expect = require('chai').expect; | ||
|
||
function getJsObj(fileName) { | ||
var jsObj = ICUConverter.parse(fs.readFileSync(fileName, 'utf-8')); | ||
return jsObj; | ||
} | ||
|
||
it("can process a simple comment", function() { | ||
var jsObj = getJsObj("tests/fixtures/comments/comments1.txt"); | ||
expect(jsObj.root.msgid).to.equal('string'); | ||
}); | ||
|
||
it("can process a tailing comment", function() { | ||
var jsObj = getJsObj("tests/fixtures/comments/comments2.txt"); | ||
expect(jsObj.root.msgid).to.equal('string'); | ||
}); | ||
|
||
it("can process a nested comment", function() { | ||
var jsObj = getJsObj("tests/fixtures/comments/comments3.txt"); | ||
expect(jsObj.root.msgid).to.equal('string'); | ||
expect(jsObj.root.nested.somestring).to.equal('somestring'); | ||
}); | ||
|
||
}); |