Example #1
0
 .end(function() {
     sinon.assert.calledOnce(mwSpy1);
     sinon.assert.calledOnce(mwSpy2);
     done();
 });
Example #2
0
 setTimeout(function(){
     sinon.assert.calledOnce(spy);
     sinon.assert.calledWith(spy, 10);
 }, 100);
Example #3
0
 it('should call onSelect function on section click', () => {
   expect(wrapper.find('.form-builder-fieldset')).to.have.prop('onClick');
   wrapper.find('.form-builder-fieldset').simulate('click');
   sinon.assert.calledOnce(onSelectSpy);
 });
Example #4
0
 it('should call joinSession for undefined team when team any button is pressed', () => {
     teamButtons[2].props.onClick();
     sinon.assert.calledOnce(joinSessionSpy);
     sinon.assert.calledWithExactly(joinSessionSpy);
 });
 it('should default to _defaultFormatter with name === undefined', () => {
   const module = new DateTimeFormat({ locale: { currentLocale: 'en-US' } });
   module._defaultFormatter = sinon.stub();
   module.formatDateTime({ utcTimestamp: Date.now() });
   sinon.assert.calledOnce(module._defaultFormatter);
 });
 it('should only load once', () => {
   storage.store.load()
   storage.store.load()
   sinon.assert.calledOnce(localStorage.getItem)
 })
Example #7
0
 return waitUntilReadyPromise.then(function () {
   sinon.assert.calledOnce(plugin.status.once);
 });
Example #8
0
 s3Cache.getSchemaNames(function(error, data) {
   expect(isSchemaNamesCacheValid()).to.be.true();
   expect(data).to.deep.equal([MOCK_SCHEMA_NAME]);
   sinon.assert.calledOnce(s3.getSchemaNames);
   done();
 });
Example #9
0
  'reads the "template" files from the given directory': function () {
    templateReader.read('foo/bar', {}, function () {});

    sinon.assert.calledOnce(fileReader.read);
    sinon.assert.calledWith(fileReader.read, 'foo/bar/template');
  },
 it("should call _getDefaultConfigFile", function () {
     var actual = setup.getConfig(defaultConfig, argv);
     sinon.assert.calledOnce(defaultStub);
 });
Example #11
0
		it('must create a new token in res.locals and return it', function() {
			var token = csrf.getToken(memory.req, memory.res);
			token.must.equal(memory.res.locals[csrf.LOCAL_VALUE]);
			sinon.assert.calledOnce(memory.res.cookie);
		});
Example #12
0
 it('should try to write to persistence', function () {
     roomStore.set(['test']);
     sinon.assert.calledOnce(persistenceWriteSpy);
 });
 .then(() => {
     sinon.assert.calledOnce(mockIdentityManager.removeIdentityMapping);
     sinon.assert.calledWith(mockIdentityManager.removeIdentityMapping, 'dogeid1');
 });
 .then(() => {
     sinon.assert.calledOnce(mockIdentityManager.addIdentityMapping);
     sinon.assert.calledWith(mockIdentityManager.addIdentityMapping, 'org.doge.Doge#DOGE_1', 'dogeid1');
 });
 it('should log a warning', () => {
   storage.store.load()
   sinon.assert.calledOnce(console.warn)  // eslint-disable-line no-console
 })
Example #16
0
  'checks whether a template folder exists in the given path': function () {
    templateReader.read('foo/bar', {}, function () {});

    sinon.assert.calledOnce(fs.exists);
    sinon.assert.calledWith(fs.exists, 'foo/bar/template');
  },
 it('should log a warning', () => {
   storage.store.set('key', 'value')
   clock.tick(SLEEP_TIME)
   sinon.assert.calledOnce(console.warn)  // eslint-disable-line no-console
 })
Example #18
0
  it('reads the given directory with folder-reader', function () {
    reader.read('a/b/c', {}, function () {});

    sinon.assert.calledOnce(folderReader.readFiles);
    sinon.assert.calledWith(folderReader.readFiles, 'a/b/c');
  });
Example #19
0
 it("Should add the static middleware", function () {
     utils.addBaseDir(app, base, Immutable.Map());
     sinon.assert.calledOnce(spy);
 });
Example #20
0
      it('removes a key', function() {
        model.$remove();

        sinon.assert.calledOnce(fakeKey.remove);
      });
Example #21
0
 it('should call joinSession with team 2 when team 2 button is pressed', () => {
     let chooseTeam2Spy = joinSessionSpy.withArgs(1);
     teamButtons[1].props.onClick();
     sinon.assert.calledOnce(chooseTeam2Spy);
 });
Example #22
0
      it('resolves a factory', function() {
        model.$self();

        sinon.assert.calledOnce(fake$q.defer);
        //sinon.assert.calledWith(model.$$selfFactory, fakeRoom.self());
      });
Example #23
0
 return health.waitUntilReady().then(function () {
   sinon.assert.calledOnce(plugin.status.once);
 });
Example #24
0
 return db.execute(() => {}).then(_ => sinon.assert.calledOnce(open));
Example #25
0
		test('callback should be called when call emit', function () {
			eventsObj.emit(eventName);

			sinon.assert.calledOnce(spy);
		});
Example #26
0
 .then(_ => sinon.assert.calledOnce(db.importBulk));
Example #27
0
 it("should show the help if no commands given", function() {
     init.parse("0.0.0", { _: []}, ["", ""], cbSpy);
     sinon.assert.calledOnce(helpStub);
 });
 it('Should be initialized from MapService',function() {
   sinon.assert.calledOnce(MapServiceMock.initMap);
 });
 it('should complete the run', function () {
     expect(testrun).to.be.ok;
     sinon.assert.calledOnce(testrun.start);
     sinon.assert.calledOnce(testrun.done);
     sinon.assert.calledWith(testrun.done.getCall(0), null);
 });
Example #30
0
 it("calls the function returned from the plugin method", function() {
     sinon.assert.calledOnce(initSpy); // the plugin init method
 });