(html, done)
| 19 | ] |
| 20 | |
| 21 | function 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 | |
| 56 | describe('Messages', () => { |
| 57 | it('should expose messages via result.messages', done => { |
no test coverage detected
searching dependent graphs…