Skip to content

Commit f99013b

Browse files
committed
few more tests
1 parent 4f77984 commit f99013b

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

test/cases/simple/expected.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"localName": "_test_cases_simple_source__localName"
3+
}

test/cases/simple/source.css

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

test/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { equal } from 'assert';
2+
import { readFileSync } from 'fs';
3+
import { join } from 'path';
4+
import hook from '../src';
5+
6+
describe('css-modules-require-hook', () => {
7+
describe('without options', () => {
8+
before(hook);
9+
10+
it('should return tokens', () => {
11+
const expectedTokens = JSON.parse(readFileSync(join(__dirname, './cases/simple/expected.json'), 'utf8'));
12+
const tokens = require('./cases/simple/source.css');
13+
14+
equal(JSON.stringify(expectedTokens), JSON.stringify(tokens));
15+
});
16+
});
17+
});

0 commit comments

Comments
 (0)