Skip to content

Commit aa1bee5

Browse files
committed
extra extensions test
1 parent 1b1f440 commit aa1bee5

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ module.exports = function setupHook({
125125
const isException = buildExceptionChecker(ignore);
126126

127127
// @todo add possibility to specify particular config for each extension
128-
exts.forEach(extension => attachHook(filename => fetch(filename, filename), '.css', isException));
128+
exts.forEach(extension => attachHook(filename => fetch(filename, filename), extension, isException));
129129
};
130130

131131
/**

test/api/extensions.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,38 @@ suite('api/extensions', () => {
1616
dropCache('./api/fixture/oceanic.css');
1717
});
1818
});
19+
20+
suite('uses provided extension', () => {
21+
test('should provide tokens', () => {
22+
const tokens = require('./fixture/oceanic.css');
23+
assert(tokens);
24+
});
25+
26+
setup(() => hook({extensions: '.css'}));
27+
28+
teardown(() => {
29+
detachHook('.css');
30+
dropCache('./api/fixture/oceanic.css');
31+
});
32+
});
33+
34+
suite('uses multiple extensions', () => {
35+
test('should provide tokens', () => {
36+
const tokens = require('./fixture/oceanic.css');
37+
assert(tokens);
38+
});
39+
40+
test('should provide tokens', () => {
41+
const tokens = require('./fixture/oceanic.scss');
42+
assert(tokens);
43+
});
44+
45+
setup(() => hook({extensions: ['.css', '.scss']}));
46+
47+
teardown(() => {
48+
detachHook('.css');
49+
dropCache('./api/fixture/oceanic.css');
50+
dropCache('./api/fixture/oceanic.scss');
51+
});
52+
});
1953
});

test/api/fixture/oceanic.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.color
2+
{
3+
background: #1e2a35;
4+
}

0 commit comments

Comments
 (0)