Skip to content

Commit 83753dc

Browse files
committed
Add includedFiles test
1 parent 7a4a7fb commit 83753dc

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,30 @@ test('sheetify-sass', function (t) {
88
t.test('should transform sass and scss', function (t) {
99
const expected = fs.readFileSync(path.join(__dirname, 'expected.css'))
1010

11-
t.plan(2)
11+
t.plan(4)
12+
13+
const files = new Set()
1214
browserify(path.join(__dirname, 'source.js'))
15+
.on('transform', function (transform) {
16+
transform.on('file', function (filename) {
17+
files.add(filename)
18+
})
19+
})
1320
.transform('sheetify', {
1421
transform: [ './' ]
1522
})
1623
.plugin('css-extract', {
1724
out: createWs
18-
}).bundle()
25+
})
26+
.bundle()
1927

2028
function createWs () {
2129
return bl(function (err, buf) {
2230
t.ifError(err, 'no error')
2331
t.equal(String(buf).trim(), String(expected).trim())
32+
33+
t.ok(files.has(path.join(__dirname, 'import.scss')))
34+
t.ok(files.has(path.join(__dirname, 'indent-import.sass')))
2435
})
2536
}
2637
})

0 commit comments

Comments
 (0)