4.1: the browser leg compares through toEditorNormal
CI / gate (push) Successful in 17s
CI / publish (push) Successful in 4s

This commit was merged in pull request #69.
This commit is contained in:
2026-09-14 20:21:32 +02:00
parent 758a5724e9
commit 9cd4b33020
+3 -2
View File
@@ -2,6 +2,7 @@ import assert from 'node:assert/strict'
import { readFileSync, readdirSync } from 'node:fs' import { readFileSync, readdirSync } from 'node:fs'
import { createServer } from 'node:http' import { createServer } from 'node:http'
import { extname, join } from 'node:path' import { extname, join } from 'node:path'
import { toEditorNormal } from '../dist/adf/editor-normal.js'
const contentTypes = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript' } const contentTypes = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript' }
const driver = 'http://127.0.0.1:4444' const driver = 'http://127.0.0.1:4444'
@@ -105,7 +106,7 @@ for (const [index, { json, markdown, name }] of corpus.roundTrip.entries()) {
assert.ok(result.emitted.ok, `it did not emit — ${refusal(result.emitted)}`) assert.ok(result.emitted.ok, `it did not emit — ${refusal(result.emitted)}`)
assert.equal(result.emitted.value, markdown) assert.equal(result.emitted.value, markdown)
assert.ok(result.parsed.ok, `it did not parse — ${refusal(result.parsed)}`) assert.ok(result.parsed.ok, `it did not parse — ${refusal(result.parsed)}`)
assert.deepEqual(result.parsed.value, JSON.parse(json)) assert.deepEqual(toEditorNormal(result.parsed.value), JSON.parse(json))
}) })
} }
@@ -113,7 +114,7 @@ for (const [index, { name }] of corpus.normalization.entries()) {
const result = results.normalization[index] const result = results.normalization[index]
checking(name, result, () => { checking(name, result, () => {
assert.ok(result.parsed.ok, `it did not parse — ${refusal(result.parsed)}`) assert.ok(result.parsed.ok, `it did not parse — ${refusal(result.parsed)}`)
assert.deepEqual(result.parsed.value, JSON.parse(fixture(name, '.json'))) assert.deepEqual(toEditorNormal(result.parsed.value), JSON.parse(fixture(name, '.json')))
}) })
} }