Skip to content
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

Mocha CLI Args #63

Merged
merged 22 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2f9bf81
Implement Mocha-specific args parser
Apr 14, 2020
78c2fd9
Configure new parseArgv to split Webpack and Mochapack args in output
Apr 15, 2020
310282f
Add function for converting Mocha args to options
Apr 15, 2020
4216846
Ensure options from parsed args handles Webpack and Mochapack args
Apr 16, 2020
cc64119
Refactor requireWebpackConfig to make it easier to reason about
Apr 16, 2020
e1a4194
Rename parseConfig to parseMochaOptsFile to be more explicit
Apr 16, 2020
03dade3
Improve arg translation to simplify Mocha init, rename loadReporter t…
Apr 16, 2020
2e5ccd9
Add a new Mocha initializer function and clean up eslint in tests
Apr 16, 2020
65c6cbd
Split webpack config creation into separate method and improve readab…
Apr 17, 2020
61c0270
Whoops missed that glob was an internal util instead of from external…
Apr 17, 2020
97eee28
Fix broken tests after glob replacement
Apr 17, 2020
3756585
Convert loose strings to constants
Apr 17, 2020
e0d2bd3
Begin shifting MochaWebpack constructor to prefer configuration at in…
Apr 18, 2020
4718db2
Rework library to use new args parser and Mocha initializer
Apr 20, 2020
4795d3f
Clean up and light directory structure refactor
Apr 20, 2020
b93bd66
Rename MochaWebpack to Mochapack
Apr 20, 2020
b88fb32
Drop Mocha 4 support
Apr 21, 2020
bbe419e
Loosen equality strictness for initMocha test
Apr 21, 2020
3f2c561
Ensure tests run with Mocha 6 and 7
Apr 21, 2020
82b830b
Update Mocha peer dependency version
Apr 21, 2020
9885c83
Update ts-mocha to fix mocha peer dependency issue
Apr 21, 2020
5a10721
Fix major version checking
Apr 21, 2020
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
14 changes: 13 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"error",
{ "peerDependencies": true }
],
"import/prefer-default-export": "off",
"no-duplicate-imports": "off",
"no-restricted-syntax": "off",
"no-unused-vars": "off"
Expand All @@ -31,5 +32,16 @@
"extensions": [".js", ".ts"]
}
}
}
},
"overrides": [
{
"files": ["**/*.test.**"],
"env": {
"mocha": true
},
"rules": {
"no-unused-expressions": "off"
}
}
]
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
**/*.txt
**/*.css
**/*.scss
**/*.yml
test/**/*.js
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ install:
- yarn install --immutable

env:
- WEBPACK_VERSION=4 MOCHA_VERSION=4
- WEBPACK_VERSION=4 MOCHA_VERSION=5
- WEBPACK_VERSION=4 MOCHA_VERSION=6
- WEBPACK_VERSION=4 MOCHA_VERSION=7

Expand Down
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"description": "mocha cli with webpack support",
"bin": "./bin/mochapack",
"main": "./lib/createMochaWebpack.js",
"main": "./lib/createMochapack.js",
"files": [
"*.md",
"bin",
Expand All @@ -21,7 +21,7 @@
"build": "yarn run clean-lib && tsc",
"format": "prettier '{src,test}/**/*' ./*.json --write --loglevel warn",
"lint": "eslint src/**/*.ts test/**/*.ts --fix",
"test": "yarn run clean-tmp && yarn run build && ts-mocha --timeout 10000 --recursive --require @babel/register --exit \"test/**/*.test.ts\"",
"test": "yarn run clean-tmp && yarn run build && ts-mocha --timeout 10000 --recursive --require @babel/register --exit \"{test,src}/**/*.test.ts\"",
"cover": "cross-env BABEL_ENV=coverage nyc --reporter=lcov --reporter=text npm test",
"posttest": "yarn run format && yarn run lint",
"docs:clean": "del-cli _book",
Expand All @@ -48,7 +48,7 @@
"author": "Victor Vlasenko <[email protected]>",
"license": "MIT",
"peerDependencies": {
"mocha": ">=4 <=7",
"mocha": ">=6 <=7",
"webpack": "^4.0.0"
},
"devDependencies": {
Expand All @@ -66,7 +66,10 @@
"@types/lodash": "^4.14.149",
"@types/mocha": "^5.2.7",
"@types/node": "^12.12.17",
"@types/sinon": "^9.0.0",
"@types/sinon-chai": "^3.2.4",
"@types/webpack": "^4.41.0",
"@types/yargs": "^15.0.4",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"anymatch": "3.1.1",
Expand Down Expand Up @@ -99,11 +102,12 @@
"nyc": "14.1.1",
"prettier": "^1.19.1",
"sass-loader": "6.0.7",
"sinon": "7.5.0",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"strip-ansi": "^5.2.0",
"tiny-worker": "2.3.0",
"ts-mocha": "^6.0.0",
"typescript": "^3.7.3",
"ts-mocha": "^7.0.0",
"typescript": "^3.8.3",
"webpack": "4.41.0",
"worker-loader": "2.0.0",
"write-file-webpack-plugin": "^4.2.0"
Expand Down
Loading