mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 20:51:20 +02:00
switch html-serializer tests to use jsdom
This commit is contained in:
@@ -30,9 +30,7 @@
|
||||
"is-hotkey": "^0.1.1",
|
||||
"is-image": "^1.0.1",
|
||||
"is-url": "^1.2.2",
|
||||
"jest": "^17.0.3",
|
||||
"jsdom": "9.6.0",
|
||||
"jsdom-global": "2.1.0",
|
||||
"jsdom": "^11.5.1",
|
||||
"lerna": "^2.1.2",
|
||||
"matcha": "^0.7.0",
|
||||
"mocha": "^2.5.3",
|
||||
|
@@ -12,7 +12,7 @@ import 'babel-polyfill' // eslint-disable-line import/no-extraneous-dependencies
|
||||
import Html from '..'
|
||||
import assert from 'assert'
|
||||
import fs from 'fs'
|
||||
import parse5 from 'parse5' // eslint-disable-line import/no-extraneous-dependencies
|
||||
import { JSDOM } from 'jsdom' // eslint-disable-line import/no-extraneous-dependencies
|
||||
import { Value, resetKeyGenerator } from 'slate'
|
||||
import { basename, extname, resolve } from 'path'
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('slate-html-serializer', () => {
|
||||
it(test, async () => {
|
||||
const module = require(resolve(dir, test))
|
||||
const { input, output, config, options } = module
|
||||
const html = new Html({ parseHtml: parse5.parseFragment, ...config })
|
||||
const html = new Html({ parseHtml: JSDOM.fragment, ...config })
|
||||
const value = html.deserialize(input, options)
|
||||
const actual = Value.isValue(value) ? value.toJSON() : value
|
||||
const expected = Value.isValue(output) ? output.toJSON() : output
|
||||
@@ -54,7 +54,7 @@ describe('slate-html-serializer', () => {
|
||||
it(test, async () => {
|
||||
const module = require(resolve(dir, test))
|
||||
const { input, output, rules, options } = module
|
||||
const html = new Html({ rules, parseHtml: parse5.parseFragment })
|
||||
const html = new Html({ rules, parseHtml: JSDOM.fragment })
|
||||
const string = html.serialize(input, options)
|
||||
const actual = string
|
||||
const expected = output
|
||||
|
Reference in New Issue
Block a user