Skip to content

Commit

Permalink
getting used to eclipse ide...
Browse files Browse the repository at this point in the history
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.
37 changes: 37 additions & 0 deletions tests/converter/comments_test.js
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');
});

});

0 comments on commit feb0304

Please sign in to comment.