Skip to content

Commit f02fbc8

Browse files
committed
extra plugin tests
1 parent f192655 commit f02fbc8

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

test/plugins.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,28 @@ import { equal } from 'assert';
22
import { identity } from 'lodash';
33
import hook from '../src';
44

5+
import ExtractImports from 'postcss-modules-extract-imports';
6+
import LocalByDefault from 'postcss-modules-local-by-default';
7+
import Scope from 'postcss-modules-scope';
8+
59
describe('plugins', () => {
610
describe('custom generateScopedName() function', () => {
7-
before(() => {
8-
hook({generateScopedName: identity});
11+
before(() => hook({generateScopedName: identity}));
12+
13+
it('tokens should have the same generated names', () => {
14+
const tokens = require('awesome-theme/oceanic.css');
15+
equal(tokens.color, 'color');
916
});
17+
});
18+
19+
describe('explicit way to set generateScopedName() function', () => {
20+
before(() => hook({
21+
use: [
22+
ExtractImports,
23+
LocalByDefault,
24+
new Scope({generateScopedName: identity}),
25+
],
26+
}));
1027

1128
it('tokens should have the same generated names', () => {
1229
const tokens = require('awesome-theme/oceanic.css');

0 commit comments

Comments
 (0)