mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
Added jest, jest-puppeteer and jest-image-snapshot for e2e tests
This commit is contained in:
58
webpack.config.e2e.js
Normal file
58
webpack.config.e2e.js
Normal file
@@ -0,0 +1,58 @@
|
||||
const path = require('path')
|
||||
|
||||
const jsRule = {
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader'
|
||||
}
|
||||
}
|
||||
|
||||
const amdRule = {
|
||||
parser: {
|
||||
amd: false // https://github.com/lodash/lodash/issues/3052
|
||||
}
|
||||
}
|
||||
const scssRule = {
|
||||
// load scss to string
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
{ loader: 'css-to-string-loader' },
|
||||
{ loader: 'css-loader' },
|
||||
{ loader: 'sass-loader' }
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
target: 'web',
|
||||
entry: {
|
||||
mermaid: './src/mermaid.js',
|
||||
e2e: './e2e/platform/viewer.js'
|
||||
},
|
||||
node: {
|
||||
fs: 'empty' // jison generated code requires 'fs'
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, './dist/'),
|
||||
filename: '[name].js',
|
||||
library: 'mermaid',
|
||||
libraryTarget: 'umd',
|
||||
libraryExport: 'default'
|
||||
},
|
||||
devServer: {
|
||||
contentBase: [
|
||||
path.join(__dirname, 'e2e', 'platform'),
|
||||
path.join(__dirname, 'dist')
|
||||
],
|
||||
compress: true,
|
||||
port: 9000
|
||||
},
|
||||
module: {
|
||||
rules: [amdRule, jsRule, scssRule]
|
||||
},
|
||||
externals: {
|
||||
mermaid: 'mermaid'
|
||||
},
|
||||
devtool: 'source-map'
|
||||
}
|
Reference in New Issue
Block a user