mirror of
https://github.com/danbulant/markdown-wasm
synced 2026-06-16 05:01:04 +00:00
adds test/spec
This commit is contained in:
parent
7ce2301dad
commit
96d9547723
3 changed files with 9735 additions and 1 deletions
28
test/spec/spec.js
Normal file
28
test/spec/spec.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
const fs = require("fs")
|
||||
const markdown = require('../../dist/markdown.node.js')
|
||||
const { exit } = require("../testutil")
|
||||
|
||||
// https://spec.commonmark.org
|
||||
const source = fs.readFileSync(__dirname + "/spec.md")
|
||||
|
||||
const timeLabel = `markdown.parse("spec.md")`
|
||||
console.time(timeLabel)
|
||||
let html = markdown.parse(source)
|
||||
console.timeEnd(timeLabel)
|
||||
|
||||
html = `
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Markdown spec</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<body>
|
||||
${html}
|
||||
</body>
|
||||
</html>
|
||||
`.trim()
|
||||
|
||||
const outfile = __dirname + "/spec.html"
|
||||
fs.writeFileSync(outfile, html, "utf8")
|
||||
exit()
|
||||
9702
test/spec/spec.md
Executable file
9702
test/spec/spec.md
Executable file
File diff suppressed because it is too large
Load diff
|
|
@ -2,6 +2,10 @@
|
|||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
node spec/spec.js &
|
||||
|
||||
for f in issue*.js; do
|
||||
node "$f" "$@"
|
||||
node "$f" "$@" &
|
||||
done
|
||||
|
||||
wait
|
||||
|
|
|
|||
Loading…
Reference in a new issue