-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Do not provide watch option to webpack to fix deprecation warning
Fixes #188
- Loading branch information
Showing
7 changed files
with
105 additions
and
42 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
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
24 changes: 24 additions & 0 deletions
24
tests/integration/fixtures/webpack/watch-not-deprecated/Gruntfile.js
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,24 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const loadGruntWebpackTasks = require('../../../../utils/loadGruntWebpackTasks'); | ||
|
||
module.exports = function (grunt) { | ||
grunt.initConfig({ | ||
webpack: { | ||
test: { | ||
watch: true, | ||
mode: "none", | ||
entry: path.join(__dirname, "entry"), | ||
output: { | ||
path: __dirname, | ||
filename: "output.js", | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ okey: JSON.stringify("dokey") }), | ||
], | ||
}, | ||
}, | ||
}); | ||
|
||
loadGruntWebpackTasks(grunt); | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/integration/fixtures/webpack/watch-not-deprecated/entry.js
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 @@ | ||
console.log(okey); |
9 changes: 9 additions & 0 deletions
9
tests/integration/fixtures/webpack/watch-not-deprecated/exec.js
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,9 @@ | ||
assertGrunt.timeout(); | ||
|
||
console.log(stdout, stderr); | ||
|
||
const content = fs.readFileSync(path.join(cwd, "output.js"), "utf-8"); | ||
expect(content).toMatch(/console\.log\("dokey"\)/); | ||
|
||
expect(stdout).not.toMatch(/DEP_WEBPACK_WATCH_WITHOUT_CALLBACK/); | ||
expect(stderr).not.toMatch(/DEP_WEBPACK_WATCH_WITHOUT_CALLBACK/); |
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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
module.exports = function (returnCode, stdout) { | ||
module.exports = function (returnCode, stdout, timeout) { | ||
return { | ||
success: function assertGruntSuccess() { | ||
expect(timeout).toBe(false); | ||
expect(returnCode).toBe(0); | ||
expect(stdout).not.toMatch(/ERROR/i); | ||
}, | ||
failed: function assertGruntSuccess() { | ||
failed: function assertGruntFailed() { | ||
expect(timeout).toBe(false); | ||
expect(returnCode).toBeGreaterThan(0); | ||
expect(stdout).toMatch(/ERROR/i); | ||
} | ||
}, | ||
timeout: function assertGruntTimeout() { | ||
expect(timeout).toBe(true); | ||
}, | ||
}; | ||
}; |