Skip to content

Commit

Permalink
added two additional test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Apr 28, 2015
1 parent 6c1eb49 commit 91366de
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/cases/parsing/hot-api/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "a";
1 change: 1 addition & 0 deletions test/cases/parsing/hot-api/b.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "b";
14 changes: 14 additions & 0 deletions test/cases/parsing/hot-api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
if(module.hot) {
it("should run module.hot.accept(...)", function() {
module.hot.accept("./a", function() {});
});
it("should run module.hot.accept()", function() {
module.hot.accept();
});
it("should run module.hot.decline", function() {
module.hot.decline("./b");
});
} else {
it("should run module.hot.* (disabled)", function() {
});
}
8 changes: 8 additions & 0 deletions test/configCases/source-map/line-to-line/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
it("should include test.js in SourceMap", function() {
var fs = require("fs");
var source = fs.readFileSync(__filename + ".map", "utf-8");
var map = JSON.parse(source);
map.sources.should.containEql("webpack:///./test.js");
});

require.include("./test.js");
3 changes: 3 additions & 0 deletions test/configCases/source-map/line-to-line/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var foo = {};

module.exports = foo;
10 changes: 10 additions & 0 deletions test/configCases/source-map/line-to-line/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
output: {
lineToLine: true
},
node: {
__dirname: false,
__filename: false
},
devtool: "cheap-source-map"
};

0 comments on commit 91366de

Please sign in to comment.