Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
dropbox-mock
Advanced tools
npm install --save-dev dropbox-mock
Global test setup:
global.Dropbox = new (require('dropbox-mock'))();
global.Dropbox.allowAppKey('FAKE-KEY-FOR-TEST');
When creating the Dropbox Client in test, you need to use the same app key that you allowed in the global test setup above.
new Dropbox.Client({key: 'FAKE-KEY-FOR-TEST'});
After exercising code that should have created records, you can inspect the fake Dropbox datastore:
global.Dropbox['MyTable']; // => yields the stored object
new Dropbox.Client
Client.authenticate()
Client.isAuthenticated()
Client.getDatastoreManager()
DatatstoreManager.openDefaultDatastore(callback)
Datastore.getTable(name)
Datastore.recordsChanged.addListener(callback)
(must be manually triggered by your test)Table.query()
(no params)Table.insert(record)
Record.get(fieldName)
Record.deleteRecord()
Record.getId()
Record.update()
Pull requests are welcome.
global.Dropbox = new (require('dropbox-mock'))();
global.Dropbox.allowAppKey('FAKE-KEY-FOR-TEST');
global.Dropbox['MyTable'] = [ { name: "Record 1", value: 1 } ];
// call subject method that queries MyTable
global.Dropbox = new (require('dropbox-mock'))();
global.Dropbox.allowAppKey('FAKE-KEY-FOR-TEST');
// call subject method that should insert records
expect(global.Dropbox['MyTable']).to.equal(expectedRecords);
global.Dropbox = new (require('dropbox-mock'))();
global.Dropbox.allowAppKey('FAKE-KEY-FOR-TEST');
// call subject method that should register a listener
global.Dropbox.triggerRecordsChanged();
// verify subject performed an action in response to a recordsChanged event
FAQs
Test double for Dropbox API
We found that dropbox-mock 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.