New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-matcher-one-of

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-matcher-one-of - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.eslintrc.json

11

package.json

@@ -8,3 +8,3 @@ {

},
"version": "0.1.0",
"version": "0.1.1",
"main": "src/index.js",

@@ -14,9 +14,14 @@ "author": "Daniel Li <dan@danyll.com>",

"devDependencies": {
"eslint": "^4.11.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.8.0",
"jest": "^21.2.1"
},
"engines": {
"node" : ">6.4.0"
"node": ">6.4.0"
},
"scripts": {
"test": "jest"
"fix": "npm run lint -- --fix",
"lint": "eslint src/index.js",
"test": "npm run lint && jest"
},

@@ -23,0 +28,0 @@ "keywords": [

expect.extend({
toBeOneOf(received, argument) {
if(!Array.isArray(argument)) {
argument = [argument];
}
const pass = argument.includes(received);
const validValues = Array.isArray(argument) ? argument : [argument];
const pass = validValues.includes(received);
if (pass) {
return {
message: () => (
`expected ${received} not to be one of [${argument.join(', ')}]`
`expected ${received} not to be one of [${validValues.join(', ')}]`
),
pass: true,
};
} else {
return {
message: () => (`expected ${received} to be one of [${argument.join(', ')}]`),
pass: false,
};
}
return {
message: () => (`expected ${received} to be one of [${validValues.join(', ')}]`),
pass: false,
};
},
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc