Skip to content

Commit

Permalink
Moved old tests out of place for new improved test cases which moves …
Browse files Browse the repository at this point in the history
…all scenarios into separate folders.
  • Loading branch information
swernerx committed Dec 17, 2018
1 parent 57002bf commit 93fe94b
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 21 deletions.
13 changes: 13 additions & 0 deletions test/flat/flat.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { bundle, clean } from "../util"

test("Flat", async () => {
const outputFile = `./output/index.js`

await bundle("flat.js", outputFile)

// await Promise.all([
// expect(fs.pathExists(outputFile)).resolves.toBeTruthy()
// ])

// await clean(outputFile)
})
23 changes: 23 additions & 0 deletions test/util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import fs from "fs-extra"
import { rollup } from "rollup"

import rebasePlugin from "../src"

export async function bundle(input, outputFile, pluginOptions = {}) {
const plugin = rebasePlugin(pluginOptions)

const result = await rollup({
input,
plugins: [ plugin ]
})

await result.write({
format: "es",
file: outputFile
})
}

export async function clean(files) {
const tasks = files.map((file) => fs.remove(file))
return Promise.all(tasks)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
21 changes: 0 additions & 21 deletions __tests__/index.js → tests-old/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
import fs from "fs-extra"
import { rollup } from "rollup"

import rebasePlugin from "../src"

const outputFolder = "./__tests__/output/"

async function bundle(input, outputFile, pluginOptions = {}) {
const plugin = rebasePlugin(pluginOptions)

const result = await rollup({
input,
plugins: [ plugin ]
})

await result.write({
format: "es",
file: outputFile
})
}

beforeAll(() => {
return fs.remove(outputFolder)
})
Expand Down

0 comments on commit 93fe94b

Please sign in to comment.