
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
NebTest will let you to test your nebulas smart contracts just like you write unit test for any javascript applications.
NebTest will let you to test your nebulas smart contracts just like you write unit test for any javascript applications.
Name | Parameters | Return | Description |
---|---|---|---|
createNewAccount | - | Account | Creates a new account from wallet |
transferToken | to, token | - | Send token to the given address from wallet |
deployContract | fileName | - | Deploy the contract file |
callContract | value, call | transaction | Call the specified methods with arguments |
transact | value, call | receipt | Returns the transaction receipt |
Install
npm install --save nebtest
npm install --save mocha chai
Include nebtest to your test case
const Nebtest = require('nebtest');
Export variables
Download and follow the instructions to create a web-wallet https://github.com/nebulasio/web-wallet
Create a wallet
From the wallet info, you will get the wallet details
export ENVIRONMENT='testnet'
export SOURCEACCOUNT='wallet private key'
export COINBASE='wallet address'
Mock Contract
Place your contract files in test directory
test/contracts/contractFile.js
Test data
Place your test data in test directory
test/testCases.json
Test data - sample format
const testData = [
{
name: 'Test Case Description',
data: [
{
name: 'Test data name',
testInput: {
...test inputs
},
testExpect: {
...test result expect
}
}
]
}
Test Cases
Write your test cases in
test/test.js
Run test
Add following command to scripts. The timeout is based on the mining time of the contract you are running. Increase the timeout if you are getting the timeout error.
"scripts": {
...
"test": "mocha --timeout 600000"
}
Run the test as,
npm run test
Check here for a complete example
FAQs
NebTest will let you to test your nebulas smart contracts just like you write unit test for any javascript applications.
The npm package nebtest receives a total of 6 weekly downloads. As such, nebtest popularity was classified as not popular.
We found that nebtest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.