mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-19 06:35:44 +01:00
Answer principles round 1: 3 🔴, 8 🟡 (0 misread); attributes as data-*, carried content as paragraphs, links and notes, no character HTML cannot hold, mutants killed
This commit is contained in:
@@ -3,6 +3,8 @@ import { createServer } from 'node:http'
|
||||
import { extname, join } from 'node:path'
|
||||
import { readFileSync, readdirSync } from 'node:fs'
|
||||
|
||||
import { adfToHtml } from '../dist/index.js'
|
||||
|
||||
const contentTypes = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript' }
|
||||
const driver = 'http://127.0.0.1:4444'
|
||||
const repoRoot = join(import.meta.dirname, '..')
|
||||
@@ -130,6 +132,7 @@ for (const [index, { json, name }] of corpus.realPayloads.entries()) {
|
||||
assert.ok(result.emitted.ok, `it did not emit — ${refusal(result.emitted)}`)
|
||||
assert.ok(result.parsed.ok, `it did not parse back — ${refusal(result.parsed)}`)
|
||||
assert.deepEqual(revived(result.parsed.value), JSON.parse(json))
|
||||
assert.deepEqual(result.html, adfToHtml(JSON.parse(json)), 'it wrote other HTML than Node wrote')
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user