
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
chai-sync-layer-suite
Advanced tools
Set of Chai matchers and helpers that simplifies process of testing sync layer (TODO wtf is sync layer).
Install via npm:
npm install --save-dev chai-sync-layer-suite
Then require it in your test helper:
// Matchers:
var syncMatchers = require('chai-sync-layer-suite/src/sync_matchers');
chai.use(syncMatchers);
// Describe helper
var describeSync = require('chai-sync-layer-suite/src/describe_sync');
window.describeSync = describeSync; // Export to global scope (window for Karma)
Real life usage example:
invitations_sync.js:
var requests = require('stores/requests');
var invitationsSync = {
get: function(token) {
return requests.get('/invitations/' + token);
},
create: function(projectId, payload) {
return requests.signedPost(
'/projects/' + projectId + '/invitations', payload
);
},
delete: function(token) {
return requests.signedDelete('/invitations/' + token);
},
accept: function(token) {
return requests.signedPut('/invitations/' + token);
}
};
module.exports = invitationsSync;
invitations_sync_test.js:
var invitationsSync = rewire('../invitations_sync');
describeSync('invitationsSync', invitationsSync, function() {
it('get', function() {
expect(invitationsSync.get.with('zaq1xsw2')).to.perform.request(
'get', '/invitations/zaq1xsw2'
);
});
it('create', function() {
expect(invitationsSync.create.with(42, { a: 'A' })).to.perform.request(
'signedPost', '/projects/42/invitations', { a: 'A' }
);
});
it('delete', function() {
expect(invitationsSync.delete.with('zaq1xsw2')).to.perform.request(
'signedDelete', '/invitations/zaq1xsw2'
);
});
it('accept', function() {
expect(invitationsSync.accept.with('zaq1xsw2')).to.perform.request(
'signedPut', '/invitations/zaq1xsw2'
);
});
});
npm test
For watch mode:
npm run-script autotest
describeSync API--
License (MIT)
FAQs
Chai suite for sync-layer library
The npm package chai-sync-layer-suite receives a total of 4 weekly downloads. As such, chai-sync-layer-suite popularity was classified as not popular.
We found that chai-sync-layer-suite 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.