diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
commit | cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch) | |
tree | 92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/glob-watcher/test/main.js | |
parent | 3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff) |
remove node_modules
Diffstat (limited to 'node_modules/glob-watcher/test/main.js')
-rw-r--r-- | node_modules/glob-watcher/test/main.js | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/node_modules/glob-watcher/test/main.js b/node_modules/glob-watcher/test/main.js deleted file mode 100644 index 2903e8f8a..000000000 --- a/node_modules/glob-watcher/test/main.js +++ /dev/null @@ -1,87 +0,0 @@ -var watch = require('../'); -var should = require('should'); -var path = require('path'); -var fs = require('fs'); -var rimraf = require('rimraf'); -var mkdirp = require('mkdirp'); - -require('mocha'); - -describe('glob-watcher', function() { - it('should return a valid file struct via EE', function(done) { - var expectedName = path.join(__dirname, "./fixtures/stuff/temp.coffee"); - var fname = path.join(__dirname, "./fixtures/**/temp.coffee"); - mkdirp.sync(path.dirname(expectedName)); - fs.writeFileSync(expectedName, "testing"); - - var watcher = watch(fname); - watcher.on('change', function(evt) { - should.exist(evt); - should.exist(evt.path); - should.exist(evt.type); - evt.type.should.equal('changed'); - evt.path.should.equal(expectedName); - watcher.end(); - }); - watcher.on('end', function(){ - rimraf.sync(expectedName); - done(); - }); - setTimeout(function(){ - fs.writeFileSync(expectedName, "test test"); - }, 125); - }); - - it('should emit nomatch via EE', function(done) { - var fname = path.join(__dirname, "./doesnt_exist_lol/temp.coffee"); - - var watcher = watch(fname); - watcher.on('nomatch', function() { - done(); - }); - }); - - it('should return a valid file struct via callback', function(done) { - var expectedName = path.join(__dirname, "./fixtures/stuff/test.coffee"); - var fname = path.join(__dirname, "./fixtures/**/test.coffee"); - mkdirp.sync(path.dirname(expectedName)); - fs.writeFileSync(expectedName, "testing"); - - var watcher = watch(fname, function(evt) { - should.exist(evt); - should.exist(evt.path); - should.exist(evt.type); - evt.type.should.equal('changed'); - evt.path.should.equal(expectedName); - watcher.end(); - }); - - watcher.on('end', function(){ - rimraf.sync(expectedName); - done(); - }); - setTimeout(function(){ - fs.writeFileSync(expectedName, "test test"); - }, 200); - }); - - it('should not return a non-matching file struct via callback', function(done) { - var expectedName = path.join(__dirname, "./fixtures/test123.coffee"); - var fname = path.join(__dirname, "./fixtures/**/test.coffee"); - mkdirp.sync(path.dirname(expectedName)); - fs.writeFileSync(expectedName, "testing"); - - var watcher = watch(fname, function(evt) { - throw new Error("Should not have been called! "+evt.path); - }); - - setTimeout(function(){ - fs.writeFileSync(expectedName, "test test"); - }, 200); - - setTimeout(function(){ - rimraf.sync(expectedName); - done(); - }, 1500); - }); -});
\ No newline at end of file |