Skip to content

Commit

Permalink
Remove Root.raws.before
Browse files Browse the repository at this point in the history
  • Loading branch information
hudochenkov committed May 18, 2021
1 parent 50e07d1 commit 49eec3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
5 changes: 0 additions & 5 deletions lib/root.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import { ProcessOptions } from './postcss.js'
import Result from './result.js'

interface RootRaws {
/**
* The symbols before the first child to the start of file.
*/
before?: string

/**
* The space symbols after the last child to the end of file.
*/
Expand Down
21 changes: 4 additions & 17 deletions test/stringifier.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,26 +221,15 @@ it('handles document with one root and after raw', () => {
expect(s).toEqual('@foo ')
})

it('handles document with one root and before raw', () => {
let document = new Document()
let root = new Root({ raws: { before: ' ' } })
root.append(new AtRule({ name: 'foo' }))
document.append(root)

let s = document.toString()

expect(s).toEqual(' @foo')
})

it('handles document with one root and before and after', () => {
let document = new Document()
let root = new Root({ raws: { before: 'BEFORE', after: 'AFTER' } })
let root = new Root({ raws: { after: 'AFTER' } })
root.append(new AtRule({ name: 'foo' }))
document.append(root)

let s = document.toString()

expect(s).toEqual('BEFORE@fooAFTER')
expect(s).toEqual('@fooAFTER')
})

it('handles document with three roots without raws', () => {
Expand All @@ -264,7 +253,7 @@ it('handles document with three roots without raws', () => {
})

it('handles document with three roots, with before and after raws', () => {
let root1 = new Root({ raws: { before: 'BEFORE_ONE', after: 'AFTER_ONE' } })
let root1 = new Root({ raws: { after: 'AFTER_ONE' } })
root1.append(new Rule({ selector: 'a.one' }))

let root2 = new Root({ raws: { after: 'AFTER_TWO' } })
Expand All @@ -280,7 +269,5 @@ it('handles document with three roots, with before and after raws', () => {

let s = document.toString()

expect(s).toEqual(
'BEFORE_ONEa.one {}AFTER_ONEa.two {}AFTER_TWOa.three {}AFTER_THREE'
)
expect(s).toEqual('a.one {}AFTER_ONEa.two {}AFTER_TWOa.three {}AFTER_THREE')
})

0 comments on commit 49eec3a

Please sign in to comment.