(html, done)
| 7 | const expected = '<div>source</div>' |
| 8 | |
| 9 | function 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 | |
| 29 | describe('Source', () => { |
| 30 | it('Source code must not mutate', done => { |