-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathcli.js
More file actions
37 lines (29 loc) · 705 Bytes
/
cli.js
File metadata and controls
37 lines (29 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import test from 'ava'
import cli from './helpers/cli.js'
import tmp from './helpers/tmp.js'
import read from './helpers/read.js'
test('works with defaults', async (t) => {
const output = tmp('output.css')
const { error, stderr } = await cli([
'test/fixtures/a.css',
'-o',
output,
'--no-map',
])
t.falsy(error, stderr)
t.is(await read(output), await read('test/fixtures/a.css'))
})
test('fails on invalid explicit config', async (t) => {
const output = tmp('output-ignore.css')
const { error, stderr } = await cli([
'test/fixtures/a.css',
'-o',
output,
'--config',
'/foo/bar',
])
t.regex(
stderr,
/No PostCSS Config found/,
)
})