File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 77 "css-modules-loader-core" : " 0.0.11" ,
88 "object-assign" : " ^3.0.0"
99 },
10- "devDependencies" : {},
10+ "devDependencies" : {
11+ "mocha" : " ^2.2.5"
12+ },
1113 "scripts" : {
1214 "test" : " mocha test"
1315 },
Original file line number Diff line number Diff line change 1+ .app
2+ {
3+ background : # 999 ;
4+ }
Original file line number Diff line number Diff line change 1+ describe ( 'css-modules-require-hook' , function ( ) {
2+ 'use strict' ;
3+
4+ var assert = require ( 'assert' ) ;
5+ var styles ;
6+
7+ before ( function ( done ) {
8+ // loading hook
9+ require ( '..' ) ;
10+
11+ try {
12+ styles = require ( './example.css' ) ;
13+ done ( ) ;
14+ } catch ( e ) {
15+ done ( e ) ;
16+ }
17+ } ) ;
18+
19+ it ( 'loaded an object from "example.css" as a module' , function ( ) {
20+ assert . strictEqual ( typeof styles , 'object' ) ;
21+ } ) ;
22+
23+ it ( 'module has the "app" key' , function ( ) {
24+ assert ( styles . hasOwnProperty ( 'app' ) ) ;
25+ } ) ;
26+
27+ it ( 'the value of the "app" key is not an empty string' , function ( ) {
28+ assert . strictEqual ( typeof styles . app , 'string' , 'app\'s value is not a string' ) ;
29+ assert ( styles . app , 'app contains an empty string' ) ;
30+ } ) ;
31+ } ) ;
You can’t perform that action at this time.
0 commit comments