@@ -21,30 +21,30 @@ it("should prefetch and preload child chunks on chunk load", () => {
2121 __webpack_public_path__ = "/public/path/" ;
2222
2323 const promise = import ( /* webpackChunkName: "chunk1" */ "./chunk1" ) ;
24- document . head . _children . length . should . be . eql ( 1 ) ;
24+ document . head . _children . length . should . be . eql ( 2 ) ;
2525 const script = document . head . _children [ 0 ] ;
2626 script . _type . should . be . eql ( "script" ) ;
2727 should ( script . src ) . be . eql ( "/public/path/chunk1.js" )
2828 should ( script . getAttribute ( "nonce" ) ) . be . eql ( "nonce" )
2929 should ( script . crossOrigin ) . be . eql ( "anonymous" ) ;
3030 should ( script . onload ) . be . type ( "function" ) ;
3131
32+ let link = document . head . _children [ 1 ] ;
33+ link . _type . should . be . eql ( "link" ) ;
34+ should ( link . rel ) . be . eql ( "preload" ) ;
35+ should ( link . as ) . be . eql ( "script" ) ;
36+ should ( link . href ) . be . eql ( "/public/path/chunk1-b.js" ) ;
37+ should ( link . charset ) . be . eql ( "utf-8" ) ;
38+ should ( link . getAttribute ( "nonce" ) ) . be . eql ( "nonce" ) ;
39+ should ( link . crossOrigin ) . be . eql ( "anonymous" ) ;
40+
3241 __non_webpack_require__ ( "./chunk1.js" ) ;
3342 script . onload ( ) ;
3443
3544 return promise . then ( ( ex ) => {
3645 document . head . _children . length . should . be . eql ( 4 ) ;
3746
38- let link = document . head . _children [ 1 ] ;
39- link . _type . should . be . eql ( "link" ) ;
40- should ( link . rel ) . be . eql ( "preload" ) ;
41- should ( link . as ) . be . eql ( "script" ) ;
42- should ( link . href ) . be . eql ( "/public/path/chunk1-b.js" ) ;
43- should ( link . charset ) . be . eql ( "utf-8" ) ;
44- should ( link . getAttribute ( "nonce" ) ) . be . eql ( "nonce" ) ;
45- should ( link . crossOrigin ) . be . eql ( "anonymous" ) ;
46-
47- link = document . head . _children [ 2 ] ;
47+ let link = document . head . _children [ 2 ] ;
4848 link . _type . should . be . eql ( "link" ) ;
4949 should ( link . rel ) . be . eql ( "prefetch" ) ;
5050 should ( link . href ) . be . eql ( "/public/path/chunk1-c.js" ) ;
0 commit comments