Skip to content

Commit

Permalink
test(message): add test for extending from prevent tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Jan 27, 2018
1 parent 4e69577 commit 6cb238a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var describe = require('mocha').describe
var posthtml = require('../lib')

var html = '<div class="messages">Messages</div>'
var expected = '<new-root><div class="messages">Messages</div></new-root>'
var messages = [
{
type: 'dependency',
Expand All @@ -26,7 +27,6 @@ function test (html, done) {
file: './path/to/1.html',
from: tree.options.from
})

return tree
})
.use(function (tree) {
Expand All @@ -38,9 +38,12 @@ function test (html, done) {

return tree
})
.use(function (tree) {
return { tag: 'new-root', content: tree }
})
.process(html)
.then(function (result) {
expect(html).to.eql(result.html)
expect(expected).to.eql(result.html)
expect(messages).to.eql(result.messages)

done()
Expand Down

0 comments on commit 6cb238a

Please sign in to comment.