describe('#logs', () => { it('should return the correct default options when not specified'); it('#logs should return an object.', () => { const logsResult = compose.logs(['string1', 'string2'], 'my_project', {'pull': true}); expect(logsResult).to.be.an('object'); }); });
it('can be trained', () => { const recognizer = createFaceRecognizer() const trainFaces = loadTrainFaces() recognizer.addFaces(trainFaces.sheldon, 'sheldon') recognizer.addFaces(trainFaces.raj, 'raj') const modelState = recognizer.getDescriptorState() expect(modelState).to.be.an('array').lengthOf(2) expect(modelState).to.deep.have.members([ { className: 'sheldon', numFaces: 2 }, { className: 'raj', numFaces: 2 } ]) })
describe('art', () => { it('should return an object', () => { art.should.be.an('object'); }); _.forEach(_.keys(art), key => { it(`it should run ${key} without an error and return a string`, () => { const result = art[key](); result.should.be.a('string'); }); }); });
_.each(metricsProvider._aggregation, (value, key) => { expect(key) .to.be.a("string") .that.equals(AGGREGATE_TIME_LEVELS[index++]); expect(value) .to.be.an("object") .that.deep.equals({ data: [], lastTimeIndex: undefined, lastAggregateIndex: 0, scrollOffset: 0 }); });
describe("constructor", () => { it("should create a popup screen", () => { const gotoTimeView = new GotoTimeView(options); expect(gotoTimeView).to.be.an.instanceof(GotoTimeView); expect(gotoTimeView).to.have.property("metricsProvider").which.is.an.instanceOf(MetricsProvider); expect(gotoTimeView).to.have.property("screen").which.is.an("object"); expect(gotoTimeView).to.have.property("parent").which.is.an.instanceOf(blessed.box); expect(gotoTimeView).to.have.property("node").which.is.an.instanceOf(blessed.node); expect(gotoTimeView).to.have.property("form").which.is.an.instanceOf(blessed.form); expect(gotoTimeView).to.have.property("timeRangeLabel").which.is.an.instanceOf(blessed.text); expect(gotoTimeView).to.have.property("textBox").which.is.an.instanceOf(blessed.textbox); expect(gotoTimeView).to.have.property("errorText").which.is.an.instanceOf(blessed.text); expect(gotoTimeView).to.have.property("acceptButton").which.is.an.instanceOf(blessed.button); expect(gotoTimeView).to.have.property("cancelButton").which.is.an.instanceOf(blessed.button); }); });
describe('#Landerode', () => { it('should inherit things from Dockerode', () => { expect(Landerode.prototype).to.be.an.instanceOf(Dockerode); }); });
describe('#run', () => { it('should return the correct default options when not specified'); it('should correctly escape opts.cmd'); it('should prefix any opts.pre to opts.cmd'); it('should set opts.cmd into an array at index 2 with /bin/sh and -c as indeces 0 and 1'); it('#run should return an object.', () => { const runResult = compose.run( ['string1', 'string2'], 'my_project', myOpts ); expect(runResult).to.be.an('object'); }); });
describe('#loadEnvs', () => { it('should return an object built from all keys from process.env that start with a given prefix', () => { process.env.DANCE_NOW = 'everybody'; const result = config.loadEnvs('DANCE'); expect(result).to.be.an('object'); expect(result).to.have.key('now'); expect(result.now).to.equal(process.env.DANCE_NOW); }); });
describe('#pull', () => { it('should return the correct default options when not specified'); it('should only pull services specified by the user in opts.services'); it('should not pull any services that are beind built locally'); it('#pull should return an object.', () => { const pullResult = compose.pull( ['string1', 'string2'], 'my_project', myOpts ); expect(pullResult).to.be.an('object'); }); });
describe('#stripEnvs', () => { it('should return process.env stripped of all keys that start with prefix', () => { process.env.DANCE_NOW = 'everybody'; const result = config.stripEnv('DANCE'); expect(result).to.be.an('object'); expect(result).to.not.have.key('DANCE_NOW'); expect(process.env).to.not.have.key('DANCE_NOW'); }); });
// receiving metrics now would cause an emit sandbox.stub(metricsProvider, "emit").callsFake((key, data, discardEvent) => { if (discardEvent) { return; } expect(key) .to.be.a("string") .that.equals("metrics"); expect(data) .to.be.an("object") .that.deep.equals( _.last(metricsProvider._aggregation[metricsProvider.zoomLevelKey].data) ); });
describe('#remove', () => { // @note: the two below seem backawards? eg purge = true -> remove? it('should use down when opts.purge is true'); it('should use rm when opts.purge is false'); it('should return the correct default options for down when not specified'); it('should return the correct default options for remove when not specified'); it('#remove should return an object.', () => { const removeResult = compose.remove( ['string1', 'string2'], 'my_project', myOpts ); expect(removeResult).to.be.an('object'); }); });
describe('#getId', () => { it('should return the correct default options when not specified'); it('#getId should return an object.', () => { const getIdResult = compose.getId( ['string1', 'string2'], 'my_project', myOpts ); expect(getIdResult).to.be.an('object'); }); });
describe('#stop', () => { it('should return the correct default options when not specified'); it('#stop should return an object.', () => { const stopResult = compose.stop( ['string1', 'string2'], 'my_project', myOpts ); expect(stopResult).to.be.an('object'); }); });
it('can be trained with jittering', () => { const recognizer = createFaceRecognizer() const numJitters = 1; const trainFaces = loadTrainFaces() recognizer.addFaces(trainFaces.sheldon, 'sheldon', numJitters) recognizer.addFaces(trainFaces.raj, 'raj', numJitters) const modelState = recognizer.getDescriptorState() expect(modelState).to.be.an('array').lengthOf(2) expect(modelState).to.deep.have.members([ { className: 'sheldon', numFaces: 4 }, { className: 'raj', numFaces: 4 } ]) })