Skip to content

Commit 43d3ddf

Browse files
committed
Add test for glob patterns
1 parent 6073e48 commit 43d3ddf

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

test/fixtures/glob/a.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.a {
2+
color: red;
3+
}

test/fixtures/glob/b.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.b {
2+
color: blue;
3+
}

test/fixtures/glob/s.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.a {
2+
color: red
3+
}

test/glob.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import test from 'ava'
2+
import path from 'path'
3+
4+
import cli from './helpers/cli.js'
5+
import tmp from './helpers/tmp.js'
6+
import read from './helpers/read.js'
7+
8+
test('works with glob patterns', async t => {
9+
const output = tmp()
10+
11+
const { error, stderr } = await cli([
12+
'test/fixtures/glob/*.css',
13+
'-d',
14+
output,
15+
'--no-map'
16+
])
17+
18+
t.ifError(error, stderr)
19+
20+
t.is(
21+
await read(path.join(output, 'a.css')),
22+
await read('test/fixtures/glob/a.css')
23+
)
24+
t.is(
25+
await read(path.join(output, 'b.css')),
26+
await read('test/fixtures/glob/b.css')
27+
)
28+
t.is(
29+
await read(path.join(output, 's.css')),
30+
await read('test/fixtures/glob/s.css')
31+
)
32+
})

0 commit comments

Comments
 (0)