Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6962 from justinhelmer/bug/6919
hot.accept tap interceptor returns T/F based on the number of args
- Loading branch information
Showing
5 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default 1; | ||
--- | ||
export default 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./module"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import value1 from "./a"; | ||
|
||
it("should have the expected static path defined", function() { | ||
DEFINE_PATH.should.be.eql('./a'); | ||
}); | ||
|
||
it("should hot.accept the module located at the static file path without breaking the compiler", function() { | ||
module.hot.accept("./a"); | ||
value1.should.be.eql(1); | ||
}); | ||
|
||
it("should hot.accept the module located at the defined file path without breaking the compiler, when one argument is passed to hot.accept", function() { | ||
module.hot.accept(DEFINE_PATH); | ||
}); | ||
|
||
it("should hot.accept the module located at the defined file path without breaking the compiler, when multiple arguments are passed to hot.accept", function(done) { | ||
module.hot.accept(DEFINE_PATH, () => done()); | ||
NEXT(require("../../update")(done)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
|
||
const webpack = require("../../../../"); | ||
|
||
module.exports = { | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
DEFINE_PATH: JSON.stringify("./a") | ||
}) | ||
] | ||
}; |