Skip to content

add unit test: add webpack 2 unit test #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "EJS webpack loader (without frontend dependencies)",
"main": "index.js",
"scripts": {
"test": "cd test && ../node_modules/.bin/webpack && node bundle.js"
"test": "npm run test:webpack1 && npm run test:webpack2",
"test:webpack1": "npm install -q [email protected] && webpack --config test/webpack1.config.js && node test/bundle.js",
"test:webpack2": "npm install -q [email protected] && webpack --config test/webpack2.config.js && node test/bundle.js"
},
"repository": {
"type": "git",
Expand All @@ -30,7 +32,6 @@
"uglify-js": "~2.6.1"
},
"devDependencies": {
"node-libs-browser": "^0.5.0",
"webpack": "^1.9.4"
"node-libs-browser": "^0.5.0"
}
}
2 changes: 1 addition & 1 deletion test/webpack.config.js → test/webpack1.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
entry: "./app.js",
entry: "./test/app.js",
cache: false,
output: {
path: __dirname,
Expand Down
23 changes: 23 additions & 0 deletions test/webpack2.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
entry: "./test/app.js",
cache: false,
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
rules: [{
test: /\.(ejs)$/,
use: {
loader: require.resolve('../'),
options: {
htmlmin: true,
htmlminOptions: {
removeComments: true,
}
},
},
}]
}

}