
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
jest-alias-preprocessor
Advanced tools
This package allows you to use aliases when testing with Jest. It's very handy when you want to use your existing webpack configuration, but you can also use it on its own.
Really, it's just a very simple wrapper on top of transform-jest-deps.
jest-alias-preprocessor
exports a higher-order function; to make it work, you have to provide a configuration object for it to use. Simply create a new file, import this module, and either import webpack.config.js
, or create a new object from scratch. Then, invoke the function, passing the config as an argument. Finally, link to the preprocessor from your Jest configuration using the scriptPreprocessor
option.
Note that your config has to look like a webpack config object even if you don't use webpack. It needs a resolve
property, and that property needs to have a root
and alias
property. You can see how it looks below.
const config = require('./webpack.config.js');
module.exports = require('jest-alias-preprocessor')(config);
module.exports = require('jest-alias-preprocessor')({
resolve: {
root: process.cwd(),
alias: {
_js: './app/js',
_utils: './app/js/utils',
},
},
});
var config = require('./webpack.config.js');
var aliasPreprocessor = require('jest-alias-preprocessor')(config);
var babel = require('babel-jest');
module.exports = {
process: function(src, path) {
src = aliasPreprocessor.process(src, path);
src = babel.process(src, path);
return src;
},
};
FAQs
A preprocessor for Jest with support for webpack aliases
The npm package jest-alias-preprocessor receives a total of 42 weekly downloads. As such, jest-alias-preprocessor popularity was classified as not popular.
We found that jest-alias-preprocessor 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.