MCPcopy
hub / github.com/posthtml/posthtml / test

Function test

test/process.js:8–30  ·  view source on GitHub ↗
(html, done)

Source from the content-addressed store, hash-verified

6const html = null
7
8function test (html, done) {
9 posthtml()
10 .use(tree => {
11 tree.walk(node => node)
12 tree.match(/(.+)/, node => node)
13
14 tree.messages.push({
15 type: 'warning',
16 message: 'tree is empty'
17 })
18
19 return tree
20 })
21 .process(html, { skipParse: true })
22 .then(result => {
23 expect('').to.eql(result.html)
24
25 done()
26 })
27 .catch(error => {
28 done(error)
29 })
30}
31
32describe('Process', () => {
33 it('should not throw on empty tree', done => {

Callers 1

process.jsFile · 0.70

Calls 2

processMethod · 0.65
useMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…