@@ -12,7 +12,7 @@ describe("Compiler", function() {
1212 new WebpackOptionsDefaulter ( ) . process ( options ) ;
1313 options . entry = entry ;
1414 options . context = path . join ( __dirname , "fixtures" ) ;
15- if ( noOutputPath ) options . output . path = "" ;
15+ if ( noOutputPath ) options . output . path = "/ " ;
1616 options . output . pathinfo = true ;
1717 var logs = {
1818 mkdirp : [ ] ,
@@ -60,22 +60,23 @@ describe("Compiler", function() {
6060
6161 compile ( "./c" , {
6262 output : {
63- path : 'what' ,
63+ path : '/ what' ,
6464 filename : 'the' + sep + 'hell.js' ,
6565 }
6666 } , function ( stats , files ) {
6767 stats . logs . mkdirp . should . eql ( [
68- 'what' ,
69- 'what' + sep + 'the' ,
68+ '/ what' ,
69+ '/ what' + sep + 'the' ,
7070 ] ) ;
7171 done ( ) ;
7272 } ) ;
7373 } ) ;
74+
7475 it ( "should compile a single file" , function ( done ) {
7576 compile ( "./c" , { } , function ( stats , files ) {
76- files . should . have . property ( "main.js" ) . have . type ( "string" ) ;
77- Object . keys ( files ) . should . be . eql ( [ "main.js" ] ) ;
78- var bundle = files [ "main.js" ] ;
77+ files . should . have . property ( "/ main.js" ) . have . type ( "string" ) ;
78+ Object . keys ( files ) . should . be . eql ( [ "/ main.js" ] ) ;
79+ var bundle = files [ "/ main.js" ] ;
7980 bundle . should . containEql ( "function __webpack_require__(" ) ;
8081 bundle . should . containEql ( "__webpack_require__(/*! ./a */ 0);" ) ;
8182 bundle . should . containEql ( "./c.js" ) ;
@@ -89,11 +90,12 @@ describe("Compiler", function() {
8990 done ( ) ;
9091 } ) ;
9192 } ) ;
93+
9294 it ( "should compile a complex file" , function ( done ) {
9395 compile ( "./main1" , { } , function ( stats , files ) {
94- files . should . have . property ( "main.js" ) . have . type ( "string" ) ;
95- Object . keys ( files ) . should . be . eql ( [ "main.js" ] ) ;
96- var bundle = files [ "main.js" ] ;
96+ files . should . have . property ( "/ main.js" ) . have . type ( "string" ) ;
97+ Object . keys ( files ) . should . be . eql ( [ "/ main.js" ] ) ;
98+ var bundle = files [ "/ main.js" ] ;
9799 bundle . should . containEql ( "function __webpack_require__(" ) ;
98100 bundle . should . containEql ( "__webpack_require__(/*! ./a */" ) ;
99101 bundle . should . containEql ( "./main1.js" ) ;
@@ -110,11 +112,12 @@ describe("Compiler", function() {
110112 done ( ) ;
111113 } ) ;
112114 } ) ;
115+
113116 it ( "should compile a file with transitive dependencies" , function ( done ) {
114117 compile ( "./abc" , { } , function ( stats , files ) {
115- files . should . have . property ( "main.js" ) . have . type ( "string" ) ;
116- Object . keys ( files ) . should . be . eql ( [ "main.js" ] ) ;
117- var bundle = files [ "main.js" ] ;
118+ files . should . have . property ( "/ main.js" ) . have . type ( "string" ) ;
119+ Object . keys ( files ) . should . be . eql ( [ "/ main.js" ] ) ;
120+ var bundle = files [ "/ main.js" ] ;
118121 bundle . should . containEql ( "function __webpack_require__(" ) ;
119122 bundle . should . containEql ( "__webpack_require__(/*! ./a */" ) ;
120123 bundle . should . containEql ( "__webpack_require__(/*! ./b */" ) ;
@@ -133,14 +136,15 @@ describe("Compiler", function() {
133136 done ( ) ;
134137 } ) ;
135138 } ) ;
139+
136140 it ( "should compile a file with multiple chunks" , function ( done ) {
137141 compile ( "./chunks" , { } , function ( stats , files ) {
138142 stats . chunks . length . should . be . eql ( 2 ) ;
139- files . should . have . property ( "main.js" ) . have . type ( "string" ) ;
140- files . should . have . property ( "0.js" ) . have . type ( "string" ) ;
141- Object . keys ( files ) . should . be . eql ( [ "0.js" , "main.js" ] ) ;
142- var bundle = files [ "main.js" ] ;
143- var chunk = files [ "0.js" ] ;
143+ files . should . have . property ( "/ main.js" ) . have . type ( "string" ) ;
144+ files . should . have . property ( "/ 0.js" ) . have . type ( "string" ) ;
145+ Object . keys ( files ) . should . be . eql ( [ "/ 0.js" , "/ main.js" ] ) ;
146+ var bundle = files [ "/ main.js" ] ;
147+ var chunk = files [ "/ 0.js" ] ;
144148 bundle . should . containEql ( "function __webpack_require__(" ) ;
145149 bundle . should . containEql ( "__webpack_require__(/*! ./b */" ) ;
146150 chunk . should . not . containEql ( "__webpack_require__(/* ./b */" ) ;
0 commit comments