01/06/21
BDD like console output
describe('KnexREST tests', function() {
it('can list databases', async function() {
/* ... */
});
});
source: mrest.js (BE-CEM-MRO)
diff error details
/*...*/
expect(ret).to.deep.include({ status: 200, body: [
{ id: 1, name: 'toto', value: 42 },
{ id: 2, name: 'titi', value: 43 },
{ id: 3, name: 'titi', value: 43 }
] });source: mrest.js (BE-CEM-MRO)
sinon.spy(DnsClient.prototype, 'query');
return q()
.then(() => DicRpc.invoke(/*...*/))
.then(
() => { throw 'should fail'; },
(err) => {
expect(err).to.be.instanceOf(NotFound);
expect(DnsClient.prototype.query.callCount)
.to.equal(1, 'should query the DNS only once');
})
.finally(() => DnsClient.prototype.query.restore());ex: checks that a deeply nested object is used only once, source: dim.js (BE-CEM-MRO)
source: coverage report
asciinema record : base-vue (BE-CEM-MRO) tests in Headless Firefox (speed x2.5)
mocha report with user control over tests
Chrome running ssvg-engine (BE-CEM-MRO) test suite
const
{ karmaConfig } = require('karma-mocha-webpack');
module.exports = function(karma) {
karma.set(karmaConfig(karma));
};base-vue (BE-CEM-MRO) configuration using karma-mocha-webpack (BE-CEM-MRO)
it('can use a dialog', async function() {
wrapper = mount(BaseDialog, { propsData: { title: 'test dialog' } });
let prom = wrapper.vm.request();
let button = await waitForWrapper(wrapper,
() => wrapper.findAll('button').filter((b) => b.text() === 'Ok'));
button.trigger('click');
expect(await prom).to.equal(true);
/*...*/
});base-vue (BE-CEM-MRO) Dialog testing
await server.run(function() {
const { EACSStub } = serverRequire('ntof-stubs');
this.env.stub.eacs.state.setState(EACSStub.EACSState.State.RUNNING);
});n_ToF operation application (op-control)
BE-CEM-MRO deployment workflow for web-apps