Skip to content

Commit

Permalink
Add test for custom outputDir
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Frampton authored and jbalsas committed Mar 27, 2017
1 parent 028f5ac commit d2fc312
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/lib/pipelines/compileSoy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
var assert = require('assert');
var childProcess = require('child_process');
var compileSoy = require('../../../lib/pipelines/compileSoy');
var del = require('del');
var ignore = require('gulp-ignore');
var path = require('path');
var sinon = require('sinon');
var vfs = require('vinyl-fs');

var outputDir = path.join(__dirname, '../../tmp');

describe('Compile Soy Pipeline', function() {
after(function(done) {
del(outputDir).then(function() {
done();
});
});

it('should compile soy files to js', function(done) {
var stream = vfs.src('test/fixtures/soy/simple.soy')
.pipe(compileSoy());
Expand All @@ -17,6 +27,18 @@ describe('Compile Soy Pipeline', function() {
});
});

it('should compile soy files to js using custom outputDir', function(done) {
var stream = vfs.src('test/fixtures/soy/simple.soy')
.pipe(compileSoy({
outputDir: outputDir
}));

stream.on('data', function(file) {
assert.strictEqual('simple.soy.js', file.relative);
done();
});
});

it('should not throw error if no files are provided for compilation', function(done) {
var stream = vfs.src('test/fixtures/soy/simple.soy')
.pipe(ignore.exclude('*.soy'))
Expand Down

0 comments on commit d2fc312

Please sign in to comment.