Replace Karma + Jasmine with Jest

This commit is contained in:
Tyler Long
2018-03-10 08:42:59 +08:00
parent cbb884edae
commit d904574ea8
7 changed files with 143 additions and 1895 deletions

View File

@@ -1,24 +0,0 @@
/* eslint-env jasmine */
describe('class diagram, ', function () {
describe('when rendering a classDiagram', function () {
beforeEach(function () {
Object.defineProperties(window.HTMLElement.prototype, {
getBBox: {
get: function () { return { x: 10, y: 10, width: 100, height: 100 } }
},
offsetLeft: {
get: function () { return parseFloat(window.getComputedStyle(this).marginLeft) || 0 }
},
offsetTop: {
get: function () { return parseFloat(window.getComputedStyle(this).marginTop) || 0 }
},
offsetHeight: {
get: function () { return parseFloat(window.getComputedStyle(this).height) || 0 }
},
offsetWidth: {
get: function () { return parseFloat(window.getComputedStyle(this).width) || 0 }
}
})
})
})
})

View File

@@ -1,22 +1,7 @@
/* eslint-env jasmine */
import { parser } from './parser/sequenceDiagram'
import sequenceDb from './sequenceDb'
import MyModuleInjector from 'inject-loader!./sequenceRenderer' // eslint-disable-line import/no-webpack-loader-syntax
let NewD3
const d3 = {
select: function () {
return new NewD3()
},
selectAll: function () {
return new NewD3()
}
}
const renderer = MyModuleInjector({
'd3': d3
})
import renderer from './sequenceRenderer'
function addConf (conf, key, value) {
if (value !== undefined) {
@@ -730,36 +715,6 @@ describe('when rendering a sequenceDiagram', function () {
parser.yy = sequenceDb
parser.yy.clear()
NewD3 = function () {
const o = {
append: function () {
return NewD3()
},
attr: function () {
return this
},
style: function () {
return this
},
text: function () {
return this
},
0: {
0: {
getBBox: function () {
return {
height: 10,
width: 20
}
}
}
}
}
return o
}
conf = {
diagramMarginX: 50,
diagramMarginY: 10,
@@ -945,36 +900,6 @@ describe('when rendering a sequenceDiagram with actor mirror activated', functio
parser.yy = sequenceDb
parser.yy.clear()
NewD3 = function () {
const o = {
append: function () {
return NewD3()
},
attr: function () {
return this
},
style: function () {
return this
},
text: function () {
return this
},
0: {
0: {
getBBox: function () {
return {
height: 10,
width: 20
}
}
}
}
}
return o
}
conf = {
diagramMarginX: 50,
diagramMarginY: 10,