Fixed tests

This commit is contained in:
Philipp A 2019-04-26 10:03:23 +02:00
parent 12b58a17e1
commit d78b33ca75
6 changed files with 19 additions and 7 deletions

View File

@ -1,5 +0,0 @@
{
"presets": [
"@babel/preset-env"
]
}

5
babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
'presets': [
'@babel/preset-env'
]
}

View File

@ -75,6 +75,12 @@
"src"
],
"jest": {
"transform": {
"^.+\\.jsx?$": "./transformer.js"
},
"transformIgnorePatterns": [
"/node_modules/(?!dagre-d3-renderer/lib).*\\.js"
],
"moduleNameMapper": {
"\\.(css|scss)$": "identity-obj-proxy"
}

View File

@ -50,7 +50,7 @@ for (const themeName of ['default', 'forest', 'dark', 'neutral']) {
*/
const config = {
/** theme , the CSS style sheet
/** theme , the CSS style sheet
*
* **theme** - Choose one of the built-in themes: default, forest, dark or neutral. To disable any pre-defined mermaid theme, use "null".
* **themeCSS** - Use your own CSS. This overrides **theme**.

3
transformer.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = require('babel-jest').createTransformer({
rootMode: 'upward'
})

View File

@ -8,7 +8,10 @@ const amdRule = {
const jsRule = {
test: /\.js$/,
exclude: /node_modules/,
include: [
path.resolve(__dirname, './src'),
path.resolve(__dirname, './node_modules/dagre-d3-renderer/lib')
],
use: {
loader: 'babel-loader'
}