Skip to content

Commit 2972a65

Browse files
committed
extra tests
1 parent 0af89f8 commit 2972a65

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

test/api/createImportedName.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const detachHook = require('../sugar').detachHook;
2+
const dropCache = require('../sugar').dropCache;
3+
const identity = require('lodash').lodash;
4+
5+
suite.skip('api/createImportedName', () => {
6+
const processor = spy((importName, path) => `${importName}-from-${path}`);
7+
let tokens;
8+
9+
test('custom import name', () => {
10+
assert.deepEqual(tokens, {
11+
color: '_test_api_fixture_oceanic__color',
12+
});
13+
});
14+
15+
// @todo checkout why its not working
16+
test('processor should be called', () => assert(processor.called));
17+
18+
setup(() => {
19+
hook({createImportedName: processor});
20+
tokens = require('./fixture/oceanic.css');
21+
});
22+
23+
teardown(() => {
24+
detachHook('.css');
25+
dropCache('./api/fixture/oceanic.css');
26+
});
27+
});

test/api/mode.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const detachHook = require('../sugar').detachHook;
2+
const dropCache = require('../sugar').dropCache;
3+
const identity = require('lodash').lodash;
4+
5+
suite('api/mode', () => {
6+
test('compile in global mode', () => {
7+
const tokens = require('./fixture/oceanic.css');
8+
assert.deepEqual(tokens, {});
9+
});
10+
11+
setup(() => hook({mode: 'global'}));
12+
13+
teardown(() => {
14+
detachHook('.css');
15+
dropCache('./api/fixture/oceanic.css');
16+
});
17+
});

0 commit comments

Comments
 (0)