Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
describe-loader
Advanced tools
describe-loader
auto-magically wrap the body of the describe expression in a describe with the path of the file (__filename
).
Install describe-loader
npm install --save-dev describe-loader
First you need to ensure that __filename is set to true otherwise __filename
will always be index.js
.
// in webpack.config
node: {
__filename: true
}
.jsx?$
or whatever extension you have// in webpack.config
module: {
preLoaders: [{}],
loaders: [{}],
postLoaders: [{
test: /\.jsx?$/,
include: /src/,
exclude: /node_modules/,
loader: 'describe'
}]
}
before:
var Component = require('component_name.jsx');
var $ = require('jquery');
describe('First describe', function() {
describe('Deep describe', function() {
beforeEach(function() {
// do something
});
it('should be ok', function() {
expect(1).to.equal(1);
});
});
});
after:
var Component = require('component_name.jsx');
var $ = require('jquery');
describe('First describe', function() {
describe('Path ' + __filename, function() {
describe('Deep describe', function() {
beforeEach(function() {
// do something
});
it('should be ok', function() {
expect(1).to.equal(1);
});
});
});
});
FAQs
Wrap root describes with path for __filename
The npm package describe-loader receives a total of 1 weekly downloads. As such, describe-loader popularity was classified as not popular.
We found that describe-loader 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.