Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frozzare committed Dec 14, 2016
1 parent 234cb17 commit b668224
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
coverage
*.pot
12 changes: 7 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ const execa = require('execa');
const assert = require('assert');

describe('Test CLI output', function () {
it('should output pot strings', function () {
it('should output pot strings', function (done) {
execa.shell('./cli.js --src test/fixtures/comments.php').then(function (result) {
assert(true, result.indexOf('"X-Poedit-SourceCharset: UTF-8\n"') !== -1);
assert(true, result.indexOf('Comment with other keyword') !== -1);
assert(true, result.stdout.indexOf('"X-Poedit-SourceCharset: UTF-8\n"') !== -1);
assert(true, result.stdout.indexOf('Comment with other keyword') !== -1);
done();
});
});
it('should output error when destination file is empty and write file is true', function () {
execa.shell('./cli.js --write-file true').then(function (result) {
it('should output error when destination file is empty and write file is true', function (done) {
execa.shell('./cli.js --write-file true').catch(function (result) {
assert('Destination file flag is empty', result);
done();
});
});
});

0 comments on commit b668224

Please sign in to comment.