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

Function test

test/source.js:9–27  ·  view source on GitHub ↗
(html, done)

Source from the content-addressed store, hash-verified

7const expected = '<div>source</div>'
8
9function test (html, done) {
10 posthtml()
11 .use(tree => tree.walk(node => {
12 if (node.attrs) {
13 delete node.attrs.class
14 }
15
16 return node
17 }))
18 .process(html)
19 .then(result => {
20 expect(html).to.eql(result.tree.source)
21 expect(expected).to.eql(result.html)
22 done()
23 })
24 .catch(error => {
25 done(error)
26 })
27}
28
29describe('Source', () => {
30 it('Source code must not mutate', done => {

Callers 1

source.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…