Files
postcss/test/comment.test.ts
T
2021-11-15 11:25:34 +03:00

20 lines
480 B
TypeScript
Executable File

import { test } from 'uvu'
import { is } from 'uvu/assert'
import { Comment, parse } from '../lib/postcss.js'
test('toString() inserts default spaces', () => {
let comment = new Comment({ text: 'hi' })
is(comment.toString(), '/* hi */')
})
test('toString() clones spaces from another comment', () => {
let root = parse('a{} /*hello*/')
let comment = new Comment({ text: 'world' })
root.append(comment)
is(root.toString(), 'a{} /*hello*/ /*world*/')
})
test.run()