Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
effects-as-data-semantic-test
Advanced tools
Based on https://github.com/orourkedd/effects-as-data#usage:
Based on https://github.com/orourkedd/effects-as-data#usage:
Given this function:
const { actions, isFailure } = require('effects-as-data/node')
const { pluck } = require('ramda')
const getListOfNames = pluck(['name'])
const saveRepositories = function * (filename) {
const {payload: username} = yield actions.prompt('\nEnter a github username: ')
const repos = yield actions.httpGet(`https://api.github.com/users/${username}/repos`)
const names = getListOfNames(repos.payload)
yield actions.logInfo(names.join('\n'))
return names
}
module.exports = {
saveRepositories
}
effects-as-data
test would look like:it('should get repositories and print names', testSaveRepositories(() => {
const repos = [
{ name: 'foo' },
{ name: 'bar' }
]
return [
['repos.json', actions.prompt('\nEnter a github username: ')],
['orourkedd', actions.httpGet('https://api.github.com/users/orourkedd/repos')],
[repos, actions.logInfo('foo\nbar')],
[null, ['foo', 'bar']]
]
}))
effects-as-data-semantic-test
test would look like:const { args } = require('./effects-as-data-semantic-test');
it('should get repositories and print names', testSaveRepositories(() => {
const repos = [
{ name: 'foo' },
{ name: 'bar' }
]
return args('repos.json')
.calls(actions.prompt('\nEnter a github username: ')).returns('orourkedd')
.calls(actions.httpGet('https://api.github.com/users/orourkedd/repos')).returns(repos)
.calls(actions.logInfo('foo\nbar')).returns(null)
.end(['foo', 'bar']);
}))
args
is the only function exposed initially. Should be what the functions arguments are.
Returns { calls }
calls
is the action/command object that is called.
Returns { returns }
returns
is what the action/command returns. Use calls
for additional action/command calls or end
to finish the function.
Returns { calls, end }
end
what the function returns. Returns the expected array of tuples for ead testing.
FAQs
Based on https://github.com/orourkedd/effects-as-data#usage:
We found that effects-as-data-semantic-test 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.