Installations
npm install jest-transform-stealthy-require
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=8.0.0
Node Version
10.19.0
NPM Version
6.13.4
Score
44.6
Supply Chain
53.6
Quality
70.4
Maintenance
100
Vulnerability
97.3
License
Contributors
Unable to fetch Contributors
Languages
TypeScript (97.08%)
JavaScript (2.92%)
Developer
antonku
Download Statistics
Total Downloads
232,549
Last Day
124
Last Week
391
Last Month
1,590
Last Year
27,635
GitHub Statistics
6 Stars
22 Commits
2 Watching
1 Branches
1 Contributors
Bundle Size
205.77 kB
Minified
48.11 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0
Package Id
jest-transform-stealthy-require@1.0.0
Unpacked Size
21.95 kB
Size
4.74 kB
File Count
11
NPM Version
6.13.4
Node Version
10.19.0
Total Downloads
Cumulative downloads
Total Downloads
232,549
Last day
134%
124
Compared to previous day
Last week
-5.6%
391
Compared to previous week
Last month
12.4%
1,590
Compared to previous month
Last year
-45.5%
27,635
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
jest-transform-stealthy-require
Transforms stealthy-require
calls into jest.isolateModules()
Motivation
The purpose of this module is to address Jest + stealthy-require compatibility issue which causes issues like Unable to expose method "then" on modules that depend on stealthy-require.
Getting started
Installation
1npm install --save-dev jest-transform-stealthy-require
Jest configuration
For request-promise/request-promise-native issue
Jest
jest.config.js
1const { requestPromise } = require('jest-transform-stealthy-require/dist/presets'); 2 3module.exports = { 4 // ... 5 transform: { 6 ...requestPromise.transform 7 }, 8 transformIgnorePatterns: [requestPromise.transformIgnorePattern] 9};
Jest + babel-jest
jest.config.js
1const { requestPromise } = require('jest-transform-stealthy-require/dist/presets'); 2 3module.exports = { 4 // ... 5 transform: { 6 ...requestPromise.transform, 7 "^.+\\.[t|j]sx?$": "babel-jest" 8 }, 9 transformIgnorePatterns: [requestPromise.transformIgnorePattern] 10}
Jest + ts-jest
jest.config.js
1const { requestPromise } = require('jest-transform-stealthy-require/dist/presets'); 2const { defaults: tsjPreset } = require('ts-jest/presets'); 3// [OR] const { jsWithTs: tsjPreset } = require('ts-jest/presets'); 4// [OR] const { jsWithBabel: tsjPreset } = require('ts-jest/presets'); 5 6module.exports = { 7 // ... 8 transform: { 9 ...requestPromise.transform, 10 ...tsjPreset.transform 11 }, 12 transformIgnorePatterns: [requestPromise.transformIgnorePattern] 13}
For other cases
The transformer can be used to replace stealthy-require calls in arbitrary modules. Simply specify the file pattern to for the modules that you would like to transform in your Jest config:
jest.config.js
1 2module.exports = { 3 // ... 4 transform: { 5 'my_pattern_to_module_to_transform': 'jest-transform-stealthy-require' 6 } 7};
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/workflow.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/antonku/jest-transform-stealthy-require/workflow.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/antonku/jest-transform-stealthy-require/workflow.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/workflow.yml:21
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
Found 0/22 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3.4
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More