fix tests
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
export default function (css) {
|
||||
const style = document.createElement('style')
|
||||
style.type = 'text/css'
|
||||
style.textContent = css
|
||||
const { head } = document
|
||||
const { firstChild } = head
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
const style = document.createElement('style')
|
||||
style.type = 'text/css'
|
||||
style.textContent = css
|
||||
const { head } = document
|
||||
const { firstChild } = head
|
||||
|
||||
if (firstChild) {
|
||||
head.insertBefore(style, firstChild)
|
||||
} else {
|
||||
head.appendChild(style)
|
||||
if (firstChild) {
|
||||
head.insertBefore(style, firstChild)
|
||||
} else {
|
||||
head.appendChild(style)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// MutationObserver is not supported by JSDom
|
||||
import MutationObserver from 'mutation-observer'
|
||||
import Editor from '../src/Editor'
|
||||
|
||||
import {
|
||||
@@ -19,6 +21,8 @@ import {
|
||||
History,
|
||||
} from '../../tiptap-extensions'
|
||||
|
||||
global.MutationObserver = MutationObserver
|
||||
|
||||
test('create editor', () => {
|
||||
const editor = new Editor()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user