Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.