Browse Source

work in progress

A. Darian 8 năm trước cách đây
mục cha
commit
63dcf8b3df
4 tập tin đã thay đổi với 11 bổ sung15 xóa
  1. 1 0
      package.json
  2. 4 1
      test/karma-cov.conf.js
  3. 4 1
      test/karma.conf.js
  4. 2 13
      test/src/notebook/cells/widget.spec.ts

+ 1 - 0
package.json

@@ -9,6 +9,7 @@
     "backbone": "^1.2.0",
     "codemirror": "^5.12.0",
     "diff-match-patch": "^1.0.0",
+    "es6-promise": "^3.2.1",
     "file-loader": "^0.8.5",
     "jquery": "^2.2.0",
     "jquery-ui": "^1.10.5",

+ 4 - 1
test/karma-cov.conf.js

@@ -6,7 +6,10 @@ module.exports = function (config) {
     browsers: ['Firefox'],
     frameworks: ['mocha'],
     reporters: ['mocha', 'coverage'],
-    files: ['test/build/coverage.js'],
+    files: [
+      'node_modules/es6-promise/dist/es6-promise.js',
+      'test/build/coverage.js'
+    ],
     coverageReporter: {
       reporters : [
         { 'type': 'text' },

+ 4 - 1
test/karma.conf.js

@@ -3,7 +3,10 @@ module.exports = function (config) {
     basePath: '..',
     frameworks: ['mocha'],
     reporters: ['mocha'],
-    files: ['test/build/bundle.js'],
+    files: [
+      'node_modules/es6-promise/dist/es6-promise.js',
+      'test/build/bundle.js'
+    ],
     port: 9876,
     colors: true,
     singleRun: true,

+ 2 - 13
test/src/notebook/cells/widget.spec.ts

@@ -458,21 +458,10 @@ describe('notebook/cells', () => {
 
     describe('#execute()', () => {
 
-      it('should change the execute count of the model', (done) => {
+      it('should return a promise', () => {
         let widget = new CodeCellWidget({ rendermime });
-
         widget.model = new CodeCellModel();
-        widget.model.source = '1 + 1';
-        expect((widget.model as ICodeCellModel).executionCount).to.be(null);
-        widget.execute(new MockKernel()).then(() => {
-          let model = widget.model as ICodeCellModel;
-          expect(model.executionCount).to.not.be(null);
-          done();
-        }).catch((reason: any) => {
-          console.log('oops:', reason);
-          done();
-        });
-
+        expect(widget.execute(new MockKernel())).to.be.a(Promise);
       });
 
     });