/* eslint-env mocha */
// The following two rules are disabled so that we can use anonymous functions with mocha
// This allows the test instance to be properly referenced with `this`
/* eslint prefer-arrow-callback: "off", func-names: "off" */

import assert from 'assert';
import sinon from 'sinon';

import KolibriApp from '../src/kolibri_app';

describe('KolibriApp', function() {
  describe('ready method', function() {
    beforeEach(function() {
      window.kolibriGlobal.registerKolibriModuleSync = sinon.spy();
      this.app = new KolibriApp();
      this.registerModuleStub = sinon.stub();
      this.store = {
        registerModule: this.registerModuleStub,
      };
      sinon.stub(this.app, 'store').get(() => this.store);
    });
    afterEach(function() {
      delete window.kolibriGlobal.registerKolibriModuleSync;
    });
    it('should call store registerModule', function() {
      this.app.ready();
      assert(this.registerModuleStub.calledOnce);
    });
    it('should call store registerModule with app state and mutations', function() {
      this.app.ready();
      assert(
        this.registerModuleStub.calledWith(
          sinon.match({ state: this.app.initialState, mutations: this.app.mutations })
        )
      );
    });
  });
});

@@ -20,260 +20,8 @@
  */%0A
-// The following two rules are disabled so that we can use anonymous functions with mocha%0A// This allows the test instance to be properly referenced with %60this%60%0A/* eslint prefer-arrow-callback: %22off%22, func-names: %22off%22 */%0A%0Aimport assert from 'assert';%0A
 impo
@@ -43,17 +43,16 @@
 sinon';%0A
-%0A
 import K
@@ -670,22 +670,39 @@
 ;%0A      
-assert
+sinon.assert.calledOnce
 (this.re
@@ -717,27 +717,16 @@
 duleStub
-.calledOnce
 );%0A    %7D
@@ -843,22 +843,39 @@
 ;%0A      
-assert
+sinon.assert.calledWith
 (%0A      
@@ -899,31 +899,18 @@
 duleStub
-.calledWith(%0A  
+,%0A
         
@@ -990,18 +990,8 @@
  %7D)%0A
-        )%0A
     

Use chai in kolibri_app test