浏览代码

Merge pull request #178 from blink1073/reinstate-tests

Switch to karma and reinstate tests
A. Darian 9 年之前
父节点
当前提交
12153644cd
共有 5 个文件被更改,包括 20 次插入11 次删除
  1. 3 3
      examples/console/index.html
  2. 3 3
      examples/notebook/index.html
  3. 3 3
      package.json
  4. 2 2
      scripts/travis_script.sh
  5. 9 0
      test/src/notebook/index.ts

+ 3 - 3
examples/console/index.html

@@ -1,10 +1,10 @@
 <!doctype html>
 <html lang="en">
   <head>
-    <title>Notebook Demo</title>
-    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full,Safe&amp;delayStartupUntil=configured"></script>
+    <title>FileBrowser Demo</title>
     <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
-    <link rel="stylesheet" type="text/css" href="index.css">
+    <script type="text/javascript" src="https://www.promisejs.org/polyfills/promise-6.1.0.js"></script>
+    <link href="index.css" rel="stylesheet">
   </head>
   <body>
     <script id='jupyter-config-data' type="application/json">{ "baseUrl": "{{base_url}}" }</script>

+ 3 - 3
examples/notebook/index.html

@@ -1,10 +1,10 @@
 <!doctype html>
 <html lang="en">
   <head>
-    <title>Notebook Demo</title>
-    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full,Safe&amp;delayStartupUntil=configured"></script>
+    <title>FileBrowser Demo</title>
     <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
-    <link rel="stylesheet" type="text/css" href="index.css">
+    <script type="text/javascript" src="https://www.promisejs.org/polyfills/promise-6.1.0.js"></script>
+    <link href="index.css" rel="stylesheet">
   </head>
   <body>
     <script id='jupyter-config-data' type="application/json">{ "baseUrl": "{{base_url}}" }</script>

+ 3 - 3
package.json

@@ -46,17 +46,17 @@
     "clean:examples": "node scripts/cleanexamples.js",
     "build:examples": "node scripts/buildexamples.js",
     "build:src": "tsc --project src && node scripts/copycss.js",
-    "build:test": "tsc --project test/src",
+    "build:test": "tsc --project test/src && webpack --config test/webpack.conf.js",
     "build": "npm run build:src && npm run build:test",
     "docs": "typedoc --options scripts/tdoptions.json",
     "postinstall": "npm dedupe",
     "prepublish": "npm run build",
     "test:chrome": "karma start --browsers=Chrome test/karma.conf.js",
-    "test:coverage": "echo 'no coverage tests enabled'",
+    "test:coverage": "webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js",
     "test:firefox": "karma start --browsers=Firefox test/karma.conf.js",
     "test:ie": "karma start --browsers=IE test/karma.conf.js",
     "test:debug": "karma start --browsers=Chrome --singleRun=false --debug=true test/karma.conf.js",
-    "test": "mocha test/build/**/*.spec.js",
+    "test": "npm run test:firefox",
     "watch:examples": "watch 'npm run build && npm run build:examples' src --wait 10",
     "watch": "watch 'npm run build' src"
   },

+ 2 - 2
scripts/travis_script.sh

@@ -4,7 +4,7 @@ sh -e /etc/init.d/xvfb start
 set -e
 npm run clean
 npm run build
-#npm test
-#npm run test:coverage
+npm test
+npm run test:coverage
 npm run build:examples
 #npm run docs

+ 9 - 0
test/src/notebook/index.ts

@@ -0,0 +1,9 @@
+// Copyright (c) Jupyter Development Team.
+// Distributed under the terms of the Modified BSD License.
+'use strict';
+
+import './cells/model.spec';
+import './input-area/model.spec';
+import './output-area/model.spec';
+import './editor/model.spec';
+import './notebook/model.spec';