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.
Helper library to assist smoke-testing of the bem technologies
npm install bem-smoke
You need to require bem-smoke
module and call testTech
method with a path to your
technology module:
var BEMSmoke = require('bem-smoke');
var tech = BEMSmoke.testTech('/absolute/path/to/tech');
You can use require.resolve
to get an absolute path from module id.
All TechTest
modules can be divided into three groups that should be called in order:
var tech = BEMTesting.testTech(require.resolve('path/to/css-tech'));
tech.withSourceFiles({
'menu': {
'menu.css': '.test1 {}',
'__item': {
'menu__item.css': '.test2 {}'
}
}
})
.build('/name', {
deps: [
{block: 'menu'},
{block: 'menu', elem: 'item'}
]
})
.producesFile('name.css')
.withContent('@import url(menu/menu.css);',
'@import url(menu/__item/menu__item.css);',
'');
withSourceFiles(fsTree)
- specifies how FS tree should look like during a test. Keys of fsTree
represent
files/directories names. If value of a key is an object, then it represents directory, if it's string or Buffer -
file with corresponding content.
withLevel(path)
- specify level to use during the test. If not called, level at root of a mock fs tree will
be used.
withLevels(levels)
- specifies levels to use for a create/bulid. levels
is an array of directory paths.
withTechMap(map)
- specifies tech map to use during tests. Map format is
{"techName": "/absolute/path/to/module"}
. Can be useful to resolve base technologies by names.
create(elem)
- performs create action for the technology. elem.block
, elem.elem
, elem.mod
and elem.val
specifies entity to create.
build(prefix, decl)
- performs build action. prefix
specifies output path prefix, decl
- declaration
to use for a build.
producesFile(path)
- assert that file at path
exists after action finishes.withContent(line1, line2, ...)
- assert that file specified at the last producesFile
has correct content
after action finishes. Each argument represents one expected line of a file.writesToFile(path)
- assert that file at path
have been written to during the test.notWritesToFile(path)
- assert that file at path
have not been written to during test.notify(callback)
- used with asynchronous test runners, such as mocha
to notify runner that test is complete.Example:
describe('example', function() {
it('completes', function(done) {
tech.withSourceFiles({
})
...
.notify(done);
});
});
Licensed under MIT license.
v0.2.0
withTechMap
setup method that allows to specify base technologies path.writesToFile
and notWritesToFile
.Context
instance.FAQs
Helper library to assist smoke-testing of the bem technologies.
The npm package bem-smoke receives a total of 2 weekly downloads. As such, bem-smoke popularity was classified as not popular.
We found that bem-smoke 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.