Skip to content

Commit 49eec3a

Browse files
committed
Remove Root.raws.before
1 parent 50e07d1 commit 49eec3a

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

lib/root.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ import { ProcessOptions } from './postcss.js'
44
import Result from './result.js'
55

66
interface RootRaws {
7-
/**
8-
* The symbols before the first child to the start of file.
9-
*/
10-
before?: string
11-
127
/**
138
* The space symbols after the last child to the end of file.
149
*/

test/stringifier.test.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,26 +221,15 @@ it('handles document with one root and after raw', () => {
221221
expect(s).toEqual('@foo ')
222222
})
223223

224-
it('handles document with one root and before raw', () => {
225-
let document = new Document()
226-
let root = new Root({ raws: { before: ' ' } })
227-
root.append(new AtRule({ name: 'foo' }))
228-
document.append(root)
229-
230-
let s = document.toString()
231-
232-
expect(s).toEqual(' @foo')
233-
})
234-
235224
it('handles document with one root and before and after', () => {
236225
let document = new Document()
237-
let root = new Root({ raws: { before: 'BEFORE', after: 'AFTER' } })
226+
let root = new Root({ raws: { after: 'AFTER' } })
238227
root.append(new AtRule({ name: 'foo' }))
239228
document.append(root)
240229

241230
let s = document.toString()
242231

243-
expect(s).toEqual('BEFORE@fooAFTER')
232+
expect(s).toEqual('@fooAFTER')
244233
})
245234

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

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

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

281270
let s = document.toString()
282271

283-
expect(s).toEqual(
284-
'BEFORE_ONEa.one {}AFTER_ONEa.two {}AFTER_TWOa.three {}AFTER_THREE'
285-
)
272+
expect(s).toEqual('a.one {}AFTER_ONEa.two {}AFTER_TWOa.three {}AFTER_THREE')
286273
})

0 commit comments

Comments
 (0)