Skip to content

Commit dca1190

Browse files
committed
Add test for simulated chunk load error, as requested from code review (required a change to HotModuleReplacement.runtime.js to allow temporarily switching of the chunk loader function to work)
1 parent 0168882 commit dca1190

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎test/cases/parsing/issue-758/index.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,15 @@ it("should not call error callback on exception thrown in require callback", fun
4848
done();
4949
});
5050
});
51+
52+
it("should call error callback when there is an error loading the chunk", function(done) {
53+
var temp = __webpack_require__.e;
54+
__webpack_require__.e = function() { return Promise.reject('fake chunk load error'); };
55+
require.ensure(['./file'], function(){
56+
var file = require('./file');
57+
}, function(error) {
58+
error.should.be.eql('fake chunk load error');
59+
done();
60+
});
61+
__webpack_require__.e = temp;
62+
});

0 commit comments

Comments
 (0)