<commit_before>import fs from "fs-extra"
import { rollup } from "rollup"
import denodeify from "denodeify"
import test from "ava"
import shortid from "shortid"

import rebasePlugin from "../src"

const stat = denodeify(fs.stat)
const rimraf = denodeify(fs.remove)
const readFile = denodeify(fs.readFile)

const outputFolder = "./output/"

process.chdir(__dirname)

function run(entry, output)
{
  var plugin = rebasePlugin({ outputFolder, entry, verbose: true })

  return rollup({
    entry,
    external: plugin.isExternal,
    plugins: [ plugin ]
  })
    .then((bundle) => bundle.write({
      dest: output
    }))
}

function fileExists(name)
{
  return stat(name)
    .then((stat) => true, (err) => false)
}

test((t) => {<commit_msg>Fixed for new rolliup<commit_after>import fs from "fs-extra"
import { rollup } from "rollup"
import denodeify from "denodeify"
import test from "ava"
import shortid from "shortid"

import rebasePlugin from "../src"

const stat = denodeify(fs.stat)
const rimraf = denodeify(fs.remove)
const readFile = denodeify(fs.readFile)

const outputFolder = "./output/"

process.chdir(__dirname)

function run(entry, output)
{
  var plugin = rebasePlugin({ outputFolder, entry, verbose: true })

  return rollup({
    entry,
    external: plugin.isExternal,
    plugins: [ plugin ]
  })
    .then((bundle) => bundle.write({
      format: "es",
      dest: output
    }))
}

function fileExists(name)
{
  return stat(name)
    .then((stat) => true, (err) => false)
}

test((t) => {
{'fraction_non_alphanumeric': 0.13925729442970822, 'fraction_numerical': 0.0, 'mean_word_length': 3.8993506493506493, 'pattern_counts': {'":': 0, '<': 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': '2041512', 'n_tokens_mistral': 509, 'n_tokens_neox': 502, 'n_words': 139}