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';
2
2
import { identity } from 'lodash' ;
3
3
import hook from '../src' ;
4
4
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
+
5
9
describe ( 'plugins' , ( ) => {
6
10
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' ) ;
9
16
} ) ;
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
+ } ) ) ;
10
27
11
28
it ( 'tokens should have the same generated names' , ( ) => {
12
29
const tokens = require ( 'awesome-theme/oceanic.css' ) ;
You can’t perform that action at this time.
0 commit comments