/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['browserify/test/watch.js']) {
  _$jscoverage['browserify/test/watch.js'] = [];
  _$jscoverage['browserify/test/watch.js'][1] = 0;
  _$jscoverage['browserify/test/watch.js'][2] = 0;
  _$jscoverage['browserify/test/watch.js'][3] = 0;
  _$jscoverage['browserify/test/watch.js'][4] = 0;
  _$jscoverage['browserify/test/watch.js'][5] = 0;
  _$jscoverage['browserify/test/watch.js'][6] = 0;
  _$jscoverage['browserify/test/watch.js'][8] = 0;
  _$jscoverage['browserify/test/watch.js'][9] = 0;
  _$jscoverage['browserify/test/watch.js'][11] = 0;
  _$jscoverage['browserify/test/watch.js'][12] = 0;
  _$jscoverage['browserify/test/watch.js'][14] = 0;
  _$jscoverage['browserify/test/watch.js'][16] = 0;
  _$jscoverage['browserify/test/watch.js'][20] = 0;
  _$jscoverage['browserify/test/watch.js'][21] = 0;
  _$jscoverage['browserify/test/watch.js'][22] = 0;
  _$jscoverage['browserify/test/watch.js'][26] = 0;
  _$jscoverage['browserify/test/watch.js'][28] = 0;
  _$jscoverage['browserify/test/watch.js'][30] = 0;
  _$jscoverage['browserify/test/watch.js'][31] = 0;
  _$jscoverage['browserify/test/watch.js'][34] = 0;
  _$jscoverage['browserify/test/watch.js'][35] = 0;
  _$jscoverage['browserify/test/watch.js'][36] = 0;
  _$jscoverage['browserify/test/watch.js'][37] = 0;
  _$jscoverage['browserify/test/watch.js'][38] = 0;
  _$jscoverage['browserify/test/watch.js'][40] = 0;
  _$jscoverage['browserify/test/watch.js'][41] = 0;
  _$jscoverage['browserify/test/watch.js'][42] = 0;
  _$jscoverage['browserify/test/watch.js'][45] = 0;
  _$jscoverage['browserify/test/watch.js'][46] = 0;
  _$jscoverage['browserify/test/watch.js'][52] = 0;
  _$jscoverage['browserify/test/watch.js'][53] = 0;
  _$jscoverage['browserify/test/watch.js'][54] = 0;
  _$jscoverage['browserify/test/watch.js'][55] = 0;
  _$jscoverage['browserify/test/watch.js'][57] = 0;
  _$jscoverage['browserify/test/watch.js'][58] = 0;
  _$jscoverage['browserify/test/watch.js'][59] = 0;
  _$jscoverage['browserify/test/watch.js'][61] = 0;
  _$jscoverage['browserify/test/watch.js'][62] = 0;
  _$jscoverage['browserify/test/watch.js'][64] = 0;
  _$jscoverage['browserify/test/watch.js'][65] = 0;
  _$jscoverage['browserify/test/watch.js'][67] = 0;
  _$jscoverage['browserify/test/watch.js'][68] = 0;
  _$jscoverage['browserify/test/watch.js'][69] = 0;
  _$jscoverage['browserify/test/watch.js'][71] = 0;
  _$jscoverage['browserify/test/watch.js'][72] = 0;
  _$jscoverage['browserify/test/watch.js'][73] = 0;
  _$jscoverage['browserify/test/watch.js'][75] = 0;
  _$jscoverage['browserify/test/watch.js'][80] = 0;
  _$jscoverage['browserify/test/watch.js'][81] = 0;
  _$jscoverage['browserify/test/watch.js'][82] = 0;
  _$jscoverage['browserify/test/watch.js'][85] = 0;
}
_$jscoverage['browserify/test/watch.js'][1]++;
var connect = require("connect");
_$jscoverage['browserify/test/watch.js'][2]++;
var http = require("http");
_$jscoverage['browserify/test/watch.js'][3]++;
var vm = require("vm");
_$jscoverage['browserify/test/watch.js'][4]++;
var fs = require("fs");
_$jscoverage['browserify/test/watch.js'][5]++;
var path = require("path");
_$jscoverage['browserify/test/watch.js'][6]++;
var test = require("tap").test;
_$jscoverage['browserify/test/watch.js'][8]++;
test("watch", (function (t) {
  _$jscoverage['browserify/test/watch.js'][9]++;
  t.plan(8);
  _$jscoverage['browserify/test/watch.js'][11]++;
  var port = 10000 + Math.floor(Math.random() * (Math.pow(2, 16) - 10000));
  _$jscoverage['browserify/test/watch.js'][12]++;
  var server = connect.createServer();
  _$jscoverage['browserify/test/watch.js'][14]++;
  var filters = 0;
  _$jscoverage['browserify/test/watch.js'][16]++;
  var bundle = require("../")({require: path.resolve(__dirname, "watch/a.js"), mount: "/bundle.js", filter: (function (src) {
  _$jscoverage['browserify/test/watch.js'][20]++;
  filters++;
  _$jscoverage['browserify/test/watch.js'][21]++;
  if (filters === 2) {
    _$jscoverage['browserify/test/watch.js'][21]++;
    t.ok(true, "has 2");
  }
  _$jscoverage['browserify/test/watch.js'][22]++;
  return src;
}), watch: {interval: 100}});
  _$jscoverage['browserify/test/watch.js'][26]++;
  server.use(bundle);
  _$jscoverage['browserify/test/watch.js'][28]++;
  server.use(connect["static"](path.resolve(__dirname, "watch")));
  _$jscoverage['browserify/test/watch.js'][30]++;
  server.listen(port, (function () {
  _$jscoverage['browserify/test/watch.js'][31]++;
  setTimeout(compareSources, 1000);
}));
  _$jscoverage['browserify/test/watch.js'][34]++;
  function getBundle(cb) {
    _$jscoverage['browserify/test/watch.js'][35]++;
    var req = {host: "localhost", port: port, path: "/bundle.js"};
    _$jscoverage['browserify/test/watch.js'][36]++;
    setTimeout((function () {
  _$jscoverage['browserify/test/watch.js'][37]++;
  http.get(req, (function (res) {
  _$jscoverage['browserify/test/watch.js'][38]++;
  t.equal(res.statusCode, 200);
  _$jscoverage['browserify/test/watch.js'][40]++;
  var src = "";
  _$jscoverage['browserify/test/watch.js'][41]++;
  res.on("data", (function (buf) {
  _$jscoverage['browserify/test/watch.js'][42]++;
  src += buf.toString();
}));
  _$jscoverage['browserify/test/watch.js'][45]++;
  res.on("end", (function () {
  _$jscoverage['browserify/test/watch.js'][46]++;
  cb(src);
}));
}));
}), 150);
}
  _$jscoverage['browserify/test/watch.js'][52]++;
  function compareSources() {
    _$jscoverage['browserify/test/watch.js'][53]++;
    getBundle((function (s1) {
  _$jscoverage['browserify/test/watch.js'][54]++;
  var m0 = bundle.modified;
  _$jscoverage['browserify/test/watch.js'][55]++;
  t.ok(m0);
  _$jscoverage['browserify/test/watch.js'][57]++;
  var c1 = {};
  _$jscoverage['browserify/test/watch.js'][58]++;
  vm.runInNewContext(s1, c1);
  _$jscoverage['browserify/test/watch.js'][59]++;
  var a1 = c1.require("./a");
  _$jscoverage['browserify/test/watch.js'][61]++;
  var a2 = Math.floor(Math.random() * 10000);
  _$jscoverage['browserify/test/watch.js'][62]++;
  var s2_ = bundle.bundle();
  _$jscoverage['browserify/test/watch.js'][64]++;
  getBundle((function (s2) {
  _$jscoverage['browserify/test/watch.js'][65]++;
  t.notEqual(s1, s2, "sources are equal");
  _$jscoverage['browserify/test/watch.js'][67]++;
  var c2 = {};
  _$jscoverage['browserify/test/watch.js'][68]++;
  vm.runInNewContext(s2, c2);
  _$jscoverage['browserify/test/watch.js'][69]++;
  var a2_ = c2.require("./a");
  _$jscoverage['browserify/test/watch.js'][71]++;
  var m1 = bundle.modified;
  _$jscoverage['browserify/test/watch.js'][72]++;
  t.ok(m1);
  _$jscoverage['browserify/test/watch.js'][73]++;
  t.ok(m1 > m0);
  _$jscoverage['browserify/test/watch.js'][75]++;
  fs.writeFileSync(path.resolve(__dirname, "watch/a.js"), "module.exports = " + a1);
  _$jscoverage['browserify/test/watch.js'][80]++;
  server.close();
  _$jscoverage['browserify/test/watch.js'][81]++;
  t.deepEqual(a2, a2_);
  _$jscoverage['browserify/test/watch.js'][82]++;
  t.end();
}));
  _$jscoverage['browserify/test/watch.js'][85]++;
  fs.writeFileSync(path.resolve(__dirname, "watch/a.js"), "module.exports = " + a2);
}));
}
}));
_$jscoverage['browserify/test/watch.js'].source = ["var connect = require('connect');","var http = require('http');","var vm = require('vm');","var fs = require('fs');","var path = require('path');","var test = require('tap').test;","","test('watch', function (t) {","    t.plan(8);","    ","    var port = 10000 + Math.floor(Math.random() * (Math.pow(2,16) - 10000));","    var server = connect.createServer();","    ","    var filters = 0;","    ","    var bundle = require('../')({","        require : path.resolve(__dirname, 'watch/a.js'),","        mount : '/bundle.js',","        filter : function (src) {","            filters ++;","            if (filters === 2) t.ok(true, 'has 2');","            return src;","        },","        watch : { interval : 100 },","    });","    server.use(bundle);","    ","    server.use(connect.static(path.resolve(__dirname, 'watch')));","    ","    server.listen(port, function () {","        setTimeout(compareSources, 1000);","    });","    ","    function getBundle (cb) {","        var req = { host : 'localhost', port : port, path : '/bundle.js' };","        setTimeout(function () {","            http.get(req, function (res) {","                t.equal(res.statusCode, 200);","                ","                var src = '';","                res.on('data', function (buf) {","                    src += buf.toString();","                });","                ","                res.on('end', function () {","                    cb(src)","                });","            });","        }, 150);","    }","    ","    function compareSources () {","        getBundle(function (s1) {","            var m0 = bundle.modified;","            t.ok(m0);","             ","            var c1 = {};","            vm.runInNewContext(s1, c1);","            var a1 = c1.require('./a');","            ","            var a2 = Math.floor(Math.random() * 10000);","            var s2_ = bundle.bundle();","            ","            getBundle(function (s2) {","                t.notEqual(s1, s2, 'sources are equal');","                ","                var c2 = {};","                vm.runInNewContext(s2, c2);","                var a2_ = c2.require('./a');","                ","                var m1 = bundle.modified;","                t.ok(m1);","                t.ok(m1 &gt; m0);","                ","                fs.writeFileSync(","                    path.resolve(__dirname, 'watch/a.js'),","                    'module.exports = ' + a1","                );","                ","                server.close();","                t.deepEqual(a2, a2_);","                t.end();","            });","            ","            fs.writeFileSync(","                path.resolve(__dirname, 'watch/a.js'),","                'module.exports = ' + a2","            );","        });","    }","});"];
