Browse Source

convert observables

Steven Silvester 6 years ago
parent
commit
65af8afef5

+ 2 - 0
tests/test-observables/jest.config.js

@@ -0,0 +1,2 @@
+const func = require('@jupyterlab/testutils/lib/jest-config');
+module.exports = func('observables', __dirname);

+ 0 - 1
tests/test-observables/karma-cov.conf.js

@@ -1 +0,0 @@
-module.exports = require('../karma-cov.conf');

+ 0 - 1
tests/test-observables/karma.conf.js

@@ -1 +0,0 @@
-module.exports = require('../karma.conf');

+ 9 - 13
tests/test-observables/package.json

@@ -5,28 +5,24 @@
   "scripts": {
     "build": "tsc -b",
     "clean": "rimraf build && rimraf coverage",
-    "coverage": "python run-test.py --browsers=ChromeHeadless karma-cov.conf.js",
-    "test": "jlpm run test:firefox",
-    "test:chrome": "python run-test.py --browsers=Chrome karma.conf.js",
-    "test:chrome-headless": "python run-test.py --browsers=ChromeHeadless karma.conf.js",
-    "test:debug": "python run-test.py  --browsers=Chrome --singleRun=false --debug=true --browserNoActivityTimeout=10000000 karma.conf.js",
-    "test:firefox": "python run-test.py --browsers=Firefox karma.conf.js",
-    "test:ie": "python run-test.py  --browsers=IE karma.conf.js",
-    "watch": "tsc -b --watch",
-    "watch:src": "tsp -p src --watch"
+    "coverage": "python run.py --coverage",
+    "test": "python run.py",
+    "watch": "python run.py --debug",
+    "watch:all": "python run.py --debug --watchAll",
+    "watch:src": "tsc -b --watch"
   },
   "dependencies": {
     "@jupyterlab/observables": "^2.1.1-alpha.0",
     "@jupyterlab/testutils": "^0.3.1-alpha.0",
     "@phosphor/algorithm": "^1.1.2",
     "@phosphor/coreutils": "^1.3.0",
-    "chai": "~4.1.2"
+    "chai": "~4.1.2",
+    "jest": "^23.5.0",
+    "ts-jest": "^23.1.4"
   },
   "devDependencies": {
     "@types/chai": "~4.0.10",
-    "karma": "~2.0.4",
-    "karma-chrome-launcher": "~2.2.0",
-    "puppeteer": "^1.5.0",
+    "@types/jest": "^23.3.1",
     "rimraf": "~2.6.2",
     "typescript": "~3.1.1"
   }

+ 3 - 5
tests/test-observables/run-test.py → tests/test-observables/run.py

@@ -1,10 +1,8 @@
 # Copyright (c) Jupyter Development Team.
 # Distributed under the terms of the Modified BSD License.
 
-import os
-from jupyterlab.tests.test_app import run_karma
-
-HERE = os.path.realpath(os.path.dirname(__file__))
+import os.path as osp
+from jupyterlab.tests.test_app import run_jest
 
 if __name__ == '__main__':
-    run_karma(HERE)
+    run_jest(osp.dirname(osp.realpath(__file__)))

+ 1 - 1
tests/test-observables/src/modeldb.spec.ts

@@ -11,7 +11,7 @@ import {
   ObservableValue,
   ObservableUndoableList,
   ObservableJSON
-} from '@jupyterlab/observables';
+} from '@jupyterlab/observables/src';
 
 describe('@jupyterlab/observables', () => {
   describe('ObservableValue', () => {

+ 1 - 1
tests/test-observables/src/observablejson.spec.ts

@@ -3,7 +3,7 @@
 
 import { expect } from 'chai';
 
-import { IObservableJSON, ObservableJSON } from '@jupyterlab/observables';
+import { IObservableJSON, ObservableJSON } from '@jupyterlab/observables/src';
 
 describe('@jupyterlab/observables', () => {
   describe('ObservableJSON', () => {

+ 1 - 1
tests/test-observables/src/observablelist.spec.ts

@@ -5,7 +5,7 @@ import { expect } from 'chai';
 
 import { toArray } from '@phosphor/algorithm';
 
-import { ObservableList } from '@jupyterlab/observables';
+import { ObservableList } from '@jupyterlab/observables/src';
 
 describe('@jupyterlab/observables', () => {
   describe('ObservableList', () => {

+ 1 - 1
tests/test-observables/src/observablemap.spec.ts

@@ -3,7 +3,7 @@
 
 import { expect } from 'chai';
 
-import { ObservableMap } from '@jupyterlab/observables';
+import { ObservableMap } from '@jupyterlab/observables/src';
 
 describe('@jupyterlab/observables', () => {
   describe('ObservableMap', () => {

+ 1 - 1
tests/test-observables/src/observablestring.spec.ts

@@ -3,7 +3,7 @@
 
 import { expect } from 'chai';
 
-import { ObservableString } from '@jupyterlab/observables';
+import { ObservableString } from '@jupyterlab/observables/src';
 
 describe('@jupyterlab/observables', () => {
   describe('ObservableString', () => {

+ 4 - 1
tests/test-observables/src/undoablelist.spec.ts

@@ -5,7 +5,10 @@ import { expect } from 'chai';
 
 import { JSONObject } from '@phosphor/coreutils';
 
-import { ObservableUndoableList, ISerializer } from '@jupyterlab/observables';
+import {
+  ObservableUndoableList,
+  ISerializer
+} from '@jupyterlab/observables/src';
 
 class Test {
   constructor(value: JSONObject) {

+ 1 - 1
tests/test-observables/tsconfig.json

@@ -2,7 +2,7 @@
   "extends": "../../tsconfigbase",
   "compilerOptions": {
     "outDir": "build",
-    "types": ["mocha"],
+    "types": ["jest"],
     "composite": false,
     "rootDir": "src"
   },