node/test/fixtures/snapshot/check-marked.js
Joyee Cheung a63af1fd64
test: add UMD module test with marked
PR-URL: https://github.com/nodejs/node/pull/38905
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-08-03 00:41:43 +08:00

22 lines
357 B
JavaScript

'use strict';
let marked;
if (process.env.NODE_TEST_USE_SNAPSHOT === 'true') {
console.error('NODE_TEST_USE_SNAPSHOT true');
marked = globalThis.marked;
} else {
console.error('NODE_TEST_USE_SNAPSHOT false');
marked = require('./marked');
}
const md = `
# heading
[link][1]
[1]: #heading "heading"
`;
const html = marked(md)
console.log(html);