Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@diotoborg/corrupti-beatae
Advanced tools
[![npm version][npm-badge]][npm-url] ![Build](https://github.com/diotoborg/corrupti-beatae/workflows/build/badge.svg) [![Dependency Status][david-badge]][david-url] [![Coveralls][BadgeCoveralls]][Coveralls] [![Maintainability](https://api.codeclimate.com/
Structured testing of seneca plugin messages.
Run Seneca messages in series (not parallel) to validate behavior against expectations.
See example folder
To use @hapi/joi
, require with:
const Joi = require('@diotoborg/corrupti-beatae').Joi
This ensures that the Joi versions match.
# file: test-spec.js
module.exports = {
print: true,
pattern: 'role:foo',
data: {
foo: {
bar: {
b0: { id: 'b0', b: 0 },
b1: { id: 'b1', b: 1 }
}
}
},
calls: [
{
// combined with top level pattern to form msg:
// role:foo,cmd:get,id:b0
pattern: 'cmd:get',
params: { id: 'b0' },
// output result must match this Optioner (Joi-based) structure
// https://github.com/rjrodger/optioner
out: { b: 0 }
},
{
// name a call to reference it later
name: 'list-0',
pattern: 'cmd:list',
params: {},
out: [{b: 0}, {b: 1}]
},
{
pattern: 'cmd:get',
// use https://github.com/rjrodger/inks back reference syntax
params: { id: '`list-0:out[1].id`' },
out: { b: 1 }
},
]
}
# basic.js
const Seneca = require('Seneca')
const SenecaMsgTest = require('..')
const seneca = Seneca().test()
// Test specification
const test_spec = require('./test-spec.js')
// Define some simplistic message actions
seneca
.use('promisify')
.use('entity')
.message('role:foo,cmd:get', async function(msg) {
return this.entity('foo/bar').load$(msg.id)
})
.message('role:foo,cmd:list', async function(msg) {
return this.entity('foo/bar').list$()
})
// Use this inside your testing code
const run_msgs = SenecaMsgTest(seneca, test_spec)
async function run_test() {
await run_msgs()
}
run_test()
CALL : cmd:get { id: 'b0' }
ERROR : null
RESULT : $-/foo/bar;id=b0;{b:0}
CALL : cmd:list {}
ERROR : null
RESULT : [ $-/foo/bar;id=b0;{b:0}, $-/foo/bar;id=b1;{b:1} ]
CALL : cmd:get { id: 'b1' }
ERROR : null
RESULT : $-/foo/bar;id=b1;{b:1}
FAQs
[![npm version][npm-badge]][npm-url] ![Build](https://github.com/diotoborg/corrupti-beatae/workflows/build/badge.svg) [![Dependency Status][david-badge]][david-url] [![Coveralls][BadgeCoveralls]][Coveralls] [![Maintainability](https://api.codeclimate.com/
The npm package @diotoborg/corrupti-beatae receives a total of 385 weekly downloads. As such, @diotoborg/corrupti-beatae popularity was classified as not popular.
We found that @diotoborg/corrupti-beatae demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.