Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Test your Node.js package against different versions of dependencies.
Note: Judge is a work in progress and may not work very well, yet. See Stability and limitations.
Let’s say you wrote a middleware for Express which is compatible with both Express 3 and Express 4. You use Travis CI to ensure that your tests pass, even against multiple versions of Node.js. However, your tests won’t run against Express 3.
Using Judge, you can specify multiple “Judge cases” (a set of dependencies) to test your package against, so you can be sure that your Express middleware works with both Express 3 and Express 4.
Judge was heavily inspired by Appraisal which offers a similar solution for Ruby gems.
Install Judge using:
$ npm install judge --save-dev
Declare Judge cases in your package.json
:
{
"name": "your-package",
"version": "1.0.0",
"dependencies": {
"express": "^4.10.6 || ^3.18.6"
},
"judge": {
"express-4": {
"express": "^4.10.6"
},
"express-3": {
"express": "^3.18.6"
}
}
}
Install all necessary dependencies using:
$ ./node_modules/.bin/judge install
You can now run any Node.js application against a specific Judge case:
$ ./node_modules/.bin/judge run express-3 grunt test
$ ./node_modules/.bin/judge run express-4 node test.js
You can configure Travis CI to use Judge when running your tests. Simply add judge install $JUDGE_CASE --overwrite
to your install process. Then specify every Judge case you want to test against as an environment variable.
language: node_js
node_js:
- "0.10"
- "0.8"
install:
- "npm install"
- "./node_modules/.bin/judge install $JUDGE_CASE --overwrite"
env:
- "JUDGE_CASE=express-3"
- "JUDGE_CASE=express-4"
Judge is currently a work in progress. For example, you may encounter the following issues and annoyances:
In general, the environment provided by judge run
may not be exactly the same as if you start the program using node
itself.
That said, using the --overwrite
option, for example to improve your CI tests, should be unproblematic.
See CHANGELOG.md.
Judge is licensed under the BSD 2-clause license. See LICENSE for the full license text.
FAQs
Test your Node.js package against different versions of dependencies.
We found that judge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.