mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-03-06 13:59:47 +01:00
* Run mocha test with module alias * Running test with babel module alias * Fix model alias * Fix model alias * Resolve module alias * Running test with babel module alias * Connect to codecov * add codecov to travis * stop if yarn test has errors * Still cannot collect data from slate modules * Try to check whether it works with codecov * Move config to nycrc * Remove nyc require * Update nyc to use src * better before_script
23 lines
777 B
JavaScript
23 lines
777 B
JavaScript
import Plain from 'slate-plain-serializer'
|
|
import assert from 'assert'
|
|
import { Value } from 'slate'
|
|
import { fixtures } from 'slate-dev-test-utils'
|
|
|
|
describe('slate-plain-serializer', () => {
|
|
fixtures(__dirname, 'deserialize', ({ module }) => {
|
|
const { input, output, options } = module
|
|
const value = Plain.deserialize(input, options)
|
|
const actual = Value.isValue(value) ? value.toJSON() : value
|
|
const expected = Value.isValue(output) ? output.toJSON() : output
|
|
assert.deepEqual(actual, expected)
|
|
})
|
|
|
|
fixtures(__dirname, 'serialize', ({ module }) => {
|
|
const { input, output, options } = module
|
|
const string = Plain.serialize(input, options)
|
|
const actual = string
|
|
const expected = output
|
|
assert.deepEqual(actual, expected)
|
|
})
|
|
})
|