<commit_before>var mock = require("mock-fs");
var expect = require("chai").expect;
var copy = require("../copy");
var StreamTest = require("streamtest");
var fs = require("fs");
describe("fs_scan", () => {
    beforeEach(() => {
        mock({
            "/source": "source",
            "/exist" : "exist"
        });
    });
    afterEach(() => mock.restore());
    StreamTest.versions.forEach(function (version) {
        describe("for " + version + " streams", function () {
            it("should copy file", function (done) {
                StreamTest[version].fromObjects([{
                    file: "/source",
                    target: "target"
                }]).pipe(copy("/")).pipe(StreamTest[version].toObjects((error) => {
                    expect(fs.existsSync("/target")).to.be.true;
                    expect(fs.readFileSync("/target","UTF-8")).to.be.equal("source");
                    done(error);
                }));
            });

            it("should not override existing file", function (done) {
                StreamTest[version].fromObjects([{<commit_msg>Fixed test group name<commit_after>var mock = require("mock-fs");
var expect = require("chai").expect;
var copy = require("../copy");
var StreamTest = require("streamtest");
var fs = require("fs");
describe("copy", () => {
    beforeEach(() => {
        mock({
            "/source": "source",
            "/exist" : "exist"
        });
    });
    afterEach(() => mock.restore());
    StreamTest.versions.forEach(function (version) {
        describe("for " + version + " streams", function () {
            it("should copy file", function (done) {
                StreamTest[version].fromObjects([{
                    file: "/source",
                    target: "target"
                }]).pipe(copy("/")).pipe(StreamTest[version].toObjects((error) => {
                    expect(fs.existsSync("/target")).to.be.true;
                    expect(fs.readFileSync("/target","UTF-8")).to.be.equal("source");
                    done(error);
                }));
            });

            it("should not override existing file", function (done) {
                StreamTest[version].fromObjects([{
{'fraction_non_alphanumeric': 0.18115612198452435, 'fraction_numerical': 0.0009103322712790169, 'mean_word_length': 1.9463806970509383, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 11, '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': '1297900', 'n_tokens_mistral': 586, 'n_tokens_neox': 565, 'n_words': 106}