From ded8c21935dd0fd5241a86b843b961075c9585fc Mon Sep 17 00:00:00 2001 From: Kelly Selden Date: Sat, 16 Jan 2016 17:49:25 -0500 Subject: [PATCH] 100% integration code coverage --- test/integration/ember-i18n-csv-test.js | 45 +++++++++++++++++++++++++ test/integration/to-csv-test.js | 18 ---------- test/integration/to-js-test.js | 26 -------------- 3 files changed, 45 insertions(+), 44 deletions(-) create mode 100644 test/integration/ember-i18n-csv-test.js delete mode 100644 test/integration/to-csv-test.js delete mode 100644 test/integration/to-js-test.js diff --git a/test/integration/ember-i18n-csv-test.js b/test/integration/ember-i18n-csv-test.js new file mode 100644 index 0000000..a5ed9c4 --- /dev/null +++ b/test/integration/ember-i18n-csv-test.js @@ -0,0 +1,45 @@ +import { expect } from 'chai'; +import fs from 'fs-extra'; +import { areFilesEqual, areDirsEqual } from 'fs-equal'; +import emberI18nCsv from '../../lib/ember-i18n-csv'; + +describe('integration - ember-i18n-csv', function() { + beforeEach(function() { + fs.emptyDirSync('tmp'); + fs.ensureDirSync('tmp/locales'); + }); + + describe('to-csv', function() { + it('works', function() { + return emberI18nCsv('to-csv', 'test/fixtures/locales', 'tmp/i18n.csv').then(() => { + return areFilesEqual('tmp/i18n.csv', 'test/fixtures/i18n.csv').then(areSame => { + expect(areSame).to.be.true; + }); + }); + }); + }); + + describe('to-js', function() { + it('works', function() { + return emberI18nCsv('to-js', 'tmp/locales', 'test/fixtures/i18n.csv').then(() => { + return areDirsEqual('tmp/locales', 'test/fixtures/locales').then(areSame => { + expect(areSame).to.be.true; + }); + }); + }); + + it('handles option --jshint-ignore', function() { + return emberI18nCsv('to-js', 'tmp/locales', 'test/fixtures/i18n.csv', { ignoreJshint: true }).then(() => { + return areDirsEqual('tmp/locales', 'test/fixtures/locales-jshint-ignore').then(areSame => { + expect(areSame).to.be.true; + }); + }); + }); + }); + + it('handles invalid', function() { + return emberI18nCsv().catch(() => { + expect(true).to.be.true; + }); + }); +}); diff --git a/test/integration/to-csv-test.js b/test/integration/to-csv-test.js deleted file mode 100644 index 57b01c5..0000000 --- a/test/integration/to-csv-test.js +++ /dev/null @@ -1,18 +0,0 @@ -import { expect } from 'chai'; -import fs from 'fs-extra'; -import { areFilesEqual } from 'fs-equal'; -import toCsv from '../../lib/to-csv'; - -describe('integration - to-csv', function() { - beforeEach(function() { - fs.emptyDirSync('tmp'); - }); - - it('works', function() { - return toCsv('test/fixtures/locales', 'tmp/i18n.csv').then(() => { - return areFilesEqual('tmp/i18n.csv', 'test/fixtures/i18n.csv').then(areSame => { - expect(areSame).to.be.true; - }); - }); - }); -}); diff --git a/test/integration/to-js-test.js b/test/integration/to-js-test.js deleted file mode 100644 index 3161b4b..0000000 --- a/test/integration/to-js-test.js +++ /dev/null @@ -1,26 +0,0 @@ -import { expect } from 'chai'; -import fs from 'fs-extra'; -import { areDirsEqual } from 'fs-equal'; -import toJs from '../../lib/to-js'; - -describe('integration - to-js', function() { - beforeEach(function() { - fs.emptyDirSync('tmp/locales'); - }); - - it('works', function() { - return toJs('test/fixtures/i18n.csv', 'tmp/locales').then(() => { - return areDirsEqual('tmp/locales', 'test/fixtures/locales').then(areSame => { - expect(areSame).to.be.true; - }); - }); - }); - - it('handles option --jshint-ignore', function() { - return toJs('test/fixtures/i18n.csv', 'tmp/locales', { ignoreJshint: true }).then(() => { - return areDirsEqual('tmp/locales', 'test/fixtures/locales-jshint-ignore').then(areSame => { - expect(areSame).to.be.true; - }); - }); - }); -});