<commit_before>"use strict";

var fs = require("fs"),
    
    browserify = require("browserify"),
    from       = require("from2-string"),
    shell      = require("shelljs"),
    
    read = require("test-utils/read.js")(__dirname),

    bundle = require("./lib/bundle.js"),
    plugin = require("../browserify.js");

describe("/browserify.js", () => {
    describe("watchify", () => {

        beforeAll(() => shell.mkdir("-p", "./packages/browserify/test/output/watchify"));
        afterEach(() => shell.rm("-rf", "./packages/browserify/test/output/watchify/*"));
        afterAll(() => shell.rm("-rf", "./packages/browserify/test/output/watchify"));
        
        // NOTE: Other watchify tests are in issue files
        it("shouldn't cache file contents between watchify runs", (done) => {
            var build = browserify();
            
            shell.cp("-f",
                "./packages/browserify/test/specimens/simple.css",
                "./packages/browserify/test/output/watchify/watched.css"
            );
            
            build.add(from("require('./packages/browserify/test/output/watchify/watched.css');"));

            build.plugin(require("watchify"));
            build.plugin(plugin, {
                css : "./packages/browserify/test/output/watchify/caching.css"
            });

            // File changed
            build.on("update", () => {
                bundle(build)<commit_msg>style: eslint fixup<commit_after>"use strict";

var browserify = require("browserify"),
    from       = require("from2-string"),
    shell      = require("shelljs"),
    
    read = require("test-utils/read.js")(__dirname),

    bundle = require("./lib/bundle.js"),
    plugin = require("../browserify.js");

describe("/browserify.js", () => {
    describe("watchify", () => {
        beforeAll(() => shell.mkdir("-p", "./packages/browserify/test/output/watchify"));
        afterEach(() => shell.rm("-rf", "./packages/browserify/test/output/watchify/*"));
        afterAll(() => shell.rm("-rf", "./packages/browserify/test/output/watchify"));
        
        // NOTE: Other watchify tests are in issue files
        it("shouldn't cache file contents between watchify runs", (done) => {
            var build = browserify();
            
            shell.cp("-f",
                "./packages/browserify/test/specimens/simple.css",
                "./packages/browserify/test/output/watchify/watched.css"
            );
            
            build.add(from("require('./packages/browserify/test/output/watchify/watched.css');"));

            build.plugin(require("watchify"));
            build.plugin(plugin, {
                css : "./packages/browserify/test/output/watchify/caching.css"
            });

            // File changed
            build.on("update", () => {
                bundle(build)
{'fraction_non_alphanumeric': 0.17839549612948627, 'fraction_numerical': 0.0007037297677691766, 'mean_word_length': 2.070194384449244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5757442', 'n_tokens_mistral': 791, 'n_tokens_neox': 782, 'n_words': 117}