Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
jest.setTimeout(20000)
jest.mock('inquirer')
const invoke = require('../lib/invoke')
const { expectPrompts } = require('inquirer')
const create = require('@vue/cli-test-utils/createTestProject')
const parseJS = file => {
const res = {}
;(new Function('module', file))(res)
return res.exports
}
const baseESLintConfig = Object.assign({}, require('@vue/cli-plugin-eslint/eslintOptions').config({
hasPlugin: () => false
}), {
rules: {
'no-console': 'off',
'no-debugger': 'off'
}
})
async function createAndInstall (name) {
const project = await create(name, {
plugins: {
'@vue/cli-plugin-babel': {}
}
})
// mock install
const pkg = JSON.parse(await project.read('package.json'))
// late invoke compat
if (invoking) {
if (api.hasPlugin('unit-mocha')) {
// eslint-disable-next-line node/no-extraneous-require
require('@vue/cli-plugin-unit-mocha/generator').applyTS(api)
}
if (api.hasPlugin('unit-jest')) {
// eslint-disable-next-line node/no-extraneous-require
require('@vue/cli-plugin-unit-jest/generator').applyTS(api)
}
if (api.hasPlugin('eslint')) {
// eslint-disable-next-line node/no-extraneous-require
require('@vue/cli-plugin-eslint/generator').applyTS(api)
}
}
api.render('./template', {
isTest: process.env.VUE_CLI_TEST || process.env.VUE_CLI_DEBUG,
hasMocha: api.hasPlugin('unit-mocha'),
hasJest: api.hasPlugin('unit-jest')
})
require('./convert')(api, { tsLint, convertJsToTs })
}