RunKit + npm: lab

var Lab = require("lab"); var Code = require("code"); const base = JSON.stringify({user:{name:'John',surname:'Doe'}}); const mutable = JSON.parse(base); // Test shortcuts const lab = exports.lab = Lab.script(); const describe = lab.experiment; const it = lab.test; const expect = Code.expect; lab.before((done)=>{ setTimeout(()=>{ console.log('before everything'); done(); },12000) }); describe('----- Updating USERS -----', () => { it('Check an user', (done) => { const cloned = JSON.parse(base); console.log('Syncrhonous code') expect(mutable).to.equal(cloned); done() }); it('Mutates an user', ()=> new Promise((res,rej) => { mutable.name = 'Jesus' console.log('Just mutating') res(); }) ); });
Created from: https://runkit.com/npm/lab
Loading…

no comments

    sign in to comment