-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathsyntax.js
More file actions
38 lines (29 loc) · 785 Bytes
/
syntax.js
File metadata and controls
38 lines (29 loc) · 785 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
38
import test from 'ava'
import cli from './helpers/cli.js'
import tmp from './helpers/tmp.js'
import read from './helpers/read.js'
test('--syntax works', async t => {
const output = tmp('output.sss')
const { error, stderr } = await cli([
'test/fixtures/a.sss',
'--syntax',
'sugarss',
'-o',
output,
'--no-map'
])
t.ifError(error, stderr)
t.is(await read(output), await read('test/fixtures/a.sss'))
})
test('automatically switch syntax', async t => {
const dir = tmp()
const { error, stderr } = await cli([
'test/fixtures/b.*',
'-d',
dir,
'--no-map'
])
t.ifError(error, stderr)
t.is(await read(`${dir}/b.sss`), await read('test/fixtures/b.sss'))
t.is(await read(`${dir}/b.css`), await read('test/fixtures/b.css'))
})