forked from postcss/postcss-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstdout.js
More file actions
27 lines (22 loc) · 646 Bytes
/
stdout.js
File metadata and controls
27 lines (22 loc) · 646 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
import test from 'ava'
import { createReadStream } from 'node:fs'
import path from 'path'
import { exec } from 'child_process'
import read from './helpers/read.js'
test.cb('writes to stdout', (t) => {
const cp = exec(
`node ${path.resolve(
'index.js',
)} --parser sugarss -u postcss-import --no-map`,
(error, stdout, stderr) => {
if (error) t.end(error, stderr)
Promise.all([stdout.replace(/\r\n/g, '\n'), read('test/fixtures/s.css')])
.then(([a, e]) => {
t.is(a, e)
t.end()
})
.catch(t.end)
},
)
createReadStream('./test/fixtures/a.sss').pipe(cp.stdin)
})