File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ const detachHook = require ( '../sugar' ) . detachHook ;
2+ const dropCache = require ( '../sugar' ) . dropCache ;
3+
4+ suite ( 'api/hashPrefix' , ( ) => {
5+ let samples = [ ] ;
6+
7+ suite ( 'using string pattern and hashPrefix' , ( ) => {
8+ let tokens ;
9+
10+ test ( 'should return tokens with prefixed id' , ( ) => assert . deepEqual ( tokens , {
11+ color : 'oceanic__color___3xlBZ' ,
12+ } ) ) ;
13+
14+ setup ( ( ) => {
15+ hook ( { generateScopedName : '[name]__[local]___[hash:base64:5]' , hashPrefix : 'test' } ) ;
16+ tokens = require ( './fixture/oceanic.css' ) ;
17+ samples . push ( tokens ) ;
18+ } ) ;
19+ } ) ;
20+
21+ suite ( 'using string pattern' , ( ) => {
22+ let tokens ;
23+
24+ test ( 'should return tokens with different hashes' , ( ) => assert . notDeepEqual (
25+ samples
26+ ) ) ;
27+
28+ setup ( ( ) => {
29+ hook ( { generateScopedName : '[name]__[local]___[hash:base64:5]' } ) ;
30+ tokens = require ( './fixture/oceanic.css' ) ;
31+ samples . push ( tokens ) ;
32+ } ) ;
33+ } ) ;
34+
35+ teardown ( ( ) => {
36+ detachHook ( '.css' ) ;
37+ dropCache ( './api/fixture/oceanic.css' ) ;
38+ } ) ;
39+ } ) ;
You can’t perform that action at this time.
0 commit comments