2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-19 21:20:34 +03:00

test: add e2e tests

This commit is contained in:
pimlie
2019-03-21 13:56:15 +01:00
committed by Pim
parent 1acadbc1b4
commit 717c30303f
12 changed files with 5749 additions and 770 deletions
+25 -2
View File
@@ -38,6 +38,7 @@ export async function buildFixture(fixture, config = {}) {
await fs.remove(webpackConfig.output.path)
// run webpack
process.env.NODE_ENV = 'test'
const webpackStats = await webpackRun(webpackConfig)
// for test debugging
@@ -73,6 +74,7 @@ export function createWebpackConfig(config = {}) {
return {
mode: 'development',
devtool: 'none',
output: {
path: path.join(path.dirname(config.entry), publicPath),
filename: '[name].js',
@@ -81,7 +83,22 @@ export function createWebpackConfig(config = {}) {
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, use: 'babel-loader' },
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', {
useBuiltIns: 'usage',
corejs: 'core-js@2',
targets: { ie: 9, safari: '5.1' }
}]
]
}
}
},
{ test: /\.vue$/, use: 'vue-loader' }
]
},
@@ -102,7 +119,13 @@ export function createWebpackConfig(config = {}) {
}
},
plugins: [
new VueLoaderPlugin()
new VueLoaderPlugin(),
new webpack.DefinePlugin({
'process.env': {
// make sure our simple polyfills are enabled
'NODE_ENV': '"test"'
}
})
],
resolve: {
alias: {
+1 -1
View File
@@ -1,2 +1,2 @@
jest.useFakeTimers()
jest.setTimeout(15000)
jest.setTimeout(30000)