
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).
mocha-loader
Advanced tools
Allows Mocha tests to be loaded and run via webpack.
To begin, you'll need to install mocha-loader
and mocha
:
npm install --save-dev mocha-loader mocha
Then add the plugin to your webpack
config. For example:
file.js
import test from './test.js';
webpack.config.js
module.exports = {
entry: './entry.js',
output: {
path: __dirname,
filename: 'bundle.js',
},
module: {
rules: [
{
test: /test\.js$/,
use: 'mocha-loader',
exclude: /node_modules/,
},
],
},
};
And run webpack
via your preferred method.
Alternative usage (without configuration):
import test from 'mocha-loader!./test.js';
No options for loader.
file.js
module.exports = true;
test.js
describe('Test', () => {
it('should succeed', (done) => {
setTimeout(done, 1000);
});
it('should fail', () => {
setTimeout(() => {
throw new Error('Failed');
}, 1000);
});
it('should randomly fail', () => {
if (require('./module')) {
throw new Error('Randomly failed');
}
});
});
Please take a moment to read our contributing guidelines if you haven't yet done so.
5.1.5 (2020-10-15)
css-loader
FAQs
Mocha loader for webpack
The npm package mocha-loader receives a total of 10,977 weekly downloads. As such, mocha-loader popularity was classified as popular.
We found that mocha-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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.