Files
30-seconds-of-code/node_modules/gatsby/cache-dir/__tests__/minimal-config.js
2019-08-20 15:52:05 +02:00

33 lines
674 B
JavaScript

const path = require(`path`)
const child = require(`child_process`)
it(`Builds cache-dir with minimal config`, done => {
const args = [
require.resolve(`@babel/cli/bin/babel.js`),
path.join(__dirname, `..`),
`--config-file`,
path.join(__dirname, `.babelrc`),
`--ignore`,
`**/__tests__`,
]
const spawn = child.spawn(process.execPath, args)
let stderr = ``
let stdout = ``
spawn.stderr.on(`data`, function(chunk) {
stderr += chunk
})
spawn.stdout.on(`data`, function(chunk) {
stdout += chunk
})
spawn.on(`close`, function() {
expect(stderr).toEqual(``)
expect(stdout).not.toEqual(``)
done()
})
}, 30000)