forked from css-modules/css-modules-require-hook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessorOpts.js
More file actions
25 lines (21 loc) · 770 Bytes
/
Copy pathprocessorOpts.js
File metadata and controls
25 lines (21 loc) · 770 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
const detachHook = require('../sugar').detachHook;
const dropCache = require('../sugar').dropCache;
const identity = require('lodash').identity;
const lessParser = require('postcss-less').parse;
// https://github.com/postcss/postcss/blob/master/docs/api.md#processorprocesscss-opts
suite('api/processorOpts()', () => {
test('should provide possibility to specify custom processor options, for example: parser', () => {
const tokens = require('./fixture/oceanic.less');
assert.deepEqual(tokens, {color: '_test_api_fixture_oceanic__color'});
});
setup(() => {
hook({
extensions: '.less',
processorOpts: {parser: lessParser},
});
});
teardown(() => {
detachHook('.less');
dropCache('./api/fixture/oceanic.less');
});
});