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

Function test

test/messages.js:21–54  ·  view source on GitHub ↗
(html, done)

Source from the content-addressed store, hash-verified

19]
20
21function test (html, done) {
22 posthtml()
23 .use(tree => {
24 tree.messages.push({
25 type: 'dependency',
26 file: './path/to/1.html',
27 from: tree.options.from
28 })
29 return tree
30 })
31 .use(tree => {
32 tree.messages.push({
33 type: 'dependency',
34 file: './path/to/2.html',
35 from: tree.options.from
36 })
37
38 return tree
39 })
40 .use(tree => ({
41 tag: 'new-root',
42 content: tree
43 }))
44 .process(html)
45 .then(result => {
46 expect(expected).to.eql(result.html)
47 expect(messages).to.eql(result.messages)
48
49 done()
50 })
51 .catch(error => {
52 done(error)
53 })
54}
55
56describe('Messages', () => {
57 it('should expose messages via result.messages', done => {

Callers 1

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