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

Avoid race conditon in watch dir tests #1149

Merged
merged 1 commit into from
Sep 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ vendor
test/html-report
test/lcov-report
test/lcov.info
test/fixtures/watching-css-out-01
test/fixtures/watching-css-out-02
coverage
12 changes: 6 additions & 6 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ describe('cli', function() {
fs.appendFileSync(foo, 'body\n\tbackground: white\n');
}, 500);
});
});

describe('node-sass --output directory', function() {
it('should watch whole directory', function(done) {
var destDir = fixture('watching-css-out/');
var destDir = fixture('watching-css-out-01/');
var srcDir = fixture('watching-dir/');
var srcFile = path.join(srcDir, 'index.scss');

Expand All @@ -366,14 +368,13 @@ describe('cli', function() {
bin.kill();
var files = fs.readdirSync(destDir);
assert.deepEqual(files, ['index.css']);
rimraf.sync(destDir);
done();
rimraf(destDir, done);
}, 200);
}, 500);
});

it('should compile all changed files in watched directory', function(done) {
var destDir = fixture('watching-css-out/');
var destDir = fixture('watching-css-out-02/');
var srcDir = fixture('watching/');
var srcFile = path.join(srcDir, 'foo.scss');

Expand All @@ -391,8 +392,7 @@ describe('cli', function() {
bin.kill();
var files = fs.readdirSync(destDir);
assert.deepEqual(files, ['foo.css', 'index.css']);
rimraf.sync(destDir);
done();
rimraf(destDir, done);
}, 200);
}, 500);
});
Expand Down