File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,28 @@ import { equal } from 'assert';
22import { identity } from 'lodash' ;
33import 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+
59describe ( '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' ) ;
You can’t perform that action at this time.
0 commit comments