Commit 1090bdf7 by Kevin Mårtensson

Merge pull request #519 from kevva/test-watch

Add test for watching files
parents 84c8b7a9 d14bd4f9
......@@ -128,7 +128,7 @@ describe('cli', function() {
it('should not exit with the --watch option', function(done) {
var src = fixture('simple/index.scss');
var bin = spawn(cli, ['--stdout', '--watch', src]);
var bin = spawn(cli, [src, '--stdout', '--watch']);
var exited;
bin.on('close', function () {
......@@ -144,6 +144,25 @@ describe('cli', function() {
}
}, 100);
});
it('should emit `warn` on file change when using --watch option', function(done) {
fs.writeFileSync(fixture('simple/tmp.scss'), '');
var src = fixture('simple/tmp.scss');
var bin = spawn(cli, [src, '--stdout', '--watch']);
bin.stderr.setEncoding('utf8');
bin.stderr.on('data', function(data) {
assert(data.trim() === '=> changed: ' + src);
bin.kill();
fs.unlinkSync(src);
done();
});
setTimeout(function() {
fs.appendFileSync(src, 'body {}');
}, 500);
});
});
describe('node-sass in.scss --output out.css', function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment