Skip to content

Commit

Permalink
remove root assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Dec 29, 2020
1 parent b6c2f95 commit c8d18e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/stringifier.js
Expand Up @@ -38,7 +38,6 @@ class Stringifier {
}

root (node) {
this.root = node
this.body(node)
if (node.raws.after) this.builder(node.raws.after)
}
Expand Down
9 changes: 9 additions & 0 deletions test/stringifier.test.js
Expand Up @@ -163,3 +163,12 @@ it('uses optional raws.indent', () => {
rule.append({ prop: 'color', value: 'black' })
expect(rule.toString()).toEqual('a {\n color: black\n}')
})

it('handles nested roots', () => {
let root = new Root()
let subRoot = new Root()
subRoot.append(new AtRule({ name: 'foo' }))
root.append(subRoot)

expect(root.toString()).toEqual('@foo')
})

0 comments on commit c8d18e6

Please sign in to comment.