Socket
Socket
Sign inDemoInstall

jest-os-detection

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-os-detection - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

.dependabot/config.yml

15

lib/index.js
"use strict";
var _os = _interopRequireDefault(require("os"));
var _patchJest = require("./patch-jest");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const currentPlatform = _os.default.platform();
(0, _patchJest.patch)(currentPlatform);
exports.__esModule = true;
var os_1 = require("os");
var patch_jest_1 = require("./patch-jest");
var currentPlatform = os_1.platform();
patch_jest_1.patch(currentPlatform);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.patch = patch;
const AVAILABLE_PLATFORMS = {
onWindows: ['win32'],
onMac: ['darwin'],
onLinux: ['linux'],
skipWindows: ['linux', 'darwin'],
skipMac: ['linux', 'win32'],
skipLinux: ['darwin', 'win32']
exports.__esModule = true;
exports.patch = void 0;
var AVAILABLE_PLATFORMS = {
onWindows: ['win32'],
onMac: ['darwin'],
onLinux: ['linux'],
skipWindows: ['linux', 'darwin'],
skipMac: ['linux', 'win32'],
skipLinux: ['darwin', 'win32']
};
var methodOperations = ['skip', 'only'];
function patch(currentPlatform) {
function newDefinition(method, expectedPlatform, fallbackImplem) {
if (AVAILABLE_PLATFORMS[expectedPlatform] && AVAILABLE_PLATFORMS[expectedPlatform].includes(currentPlatform)) {
return method;
} else {
return fallbackImplem;
function newDefinition(method, expectedPlatform, fallbackImplem) {
var _a;
if (((_a = AVAILABLE_PLATFORMS[expectedPlatform]) === null || _a === void 0 ? void 0 : _a.indexOf(currentPlatform)) !== -1) {
return method;
}
else {
return fallbackImplem;
}
}
}
Object.keys(AVAILABLE_PLATFORMS).forEach(platform => {
;
[describe, it, test].forEach(method => {
method[platform] = newDefinition(method, platform, method.skip);
method[platform].each = newDefinition(method.each, platform, method.skip.each);
['skip', 'only'].forEach(mode => {
method[platform][mode] = newDefinition(method[mode], platform, method.skip);
method[platform][mode] = newDefinition(method[mode], platform, method.skip.each);
});
Object.keys(AVAILABLE_PLATFORMS).forEach(function (platform) {
;
[describe, it, test].forEach(function (method) {
method[platform] = newDefinition(method, platform, method.skip);
method[platform].each = newDefinition(method.each, platform, method.skip.each);
methodOperations.forEach(function (mode) {
method[platform][mode] = newDefinition(method[mode], platform, method.skip);
method[platform][mode].each = newDefinition(method[mode].each, platform, method.skip.each);
});
});
});
});
}
}
exports.patch = patch;
{
"name": "jest-os-detection",
"version": "1.1.1",
"version": "1.2.0",
"description": "Allow to specify on which platform to run jest tests",

@@ -8,5 +8,6 @@ "main": "lib/index.js",

"repository": "github:doctolib/jest-os-detection",
"types": "index.d.ts",
"scripts": {
"test": "jest",
"version": "babel src --out-dir lib"
"version": "tsc --declaration src/* --outDir lib"
},

@@ -29,3 +30,6 @@ "author": "qmenoret",

"@babel/preset-env": "^7.0.0",
"@babel/preset-typescript": "^7.10.4",
"@babel/register": "^7.0.0",
"@types/jest": "^26.0.4",
"@types/node": "^14.0.23",
"babel-core": "^7.0.0-bridge.0",

@@ -35,3 +39,4 @@ "babel-jest": "^24.1.0",

"jest": "^24.9.0",
"prettier": "^1.19.1"
"prettier": "^1.19.1",
"typescript": "^3.9.7"
},

@@ -38,0 +43,0 @@ "jest": {

Sorry, the diff of this file is not supported yet

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