Explorar el Código

added in test-ui-components, build broken, need to fix

telamonian hace 5 años
padre
commit
3316ea1a09

+ 0 - 1
packages/ui-components/src/icon/labicon.tsx

@@ -40,7 +40,6 @@ export class LabIcon implements LabIcon.ILabIcon, LabIcon.IRenderer {
     if (LabIcon._debug) {
       // fail noisily
       console.error(`Invalid icon name: ${name}`);
-      return badIcon;
     }
 
     // fail silently

+ 1 - 0
tests/test-ui-components/babel.config.js

@@ -0,0 +1 @@
+module.exports = require('@jupyterlab/testutils/lib/babel.config');

+ 2 - 0
tests/test-ui-components/jest.config.js

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

+ 27 - 0
tests/test-ui-components/package.json

@@ -0,0 +1,27 @@
+{
+  "name": "@jupyterlab/ui-components",
+  "version": "2.0.0-beta.3",
+  "private": true,
+  "scripts": {
+    "build": "tsc -b",
+    "clean": "rimraf build && rimraf coverage",
+    "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/ui-components": "^2.0.0-beta.3",
+    "chai": "^4.2.0",
+    "jest": "^24.9.0",
+    "jest-junit": "^10.0.0",
+    "ts-jest": "^24.2.0"
+  },
+  "devDependencies": {
+    "@types/chai": "^4.2.7",
+    "@types/jest": "^24.0.23",
+    "rimraf": "~3.0.0",
+    "typescript": "~3.7.3"
+  }
+}

+ 8 - 0
tests/test-ui-components/run.py

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

+ 14 - 0
tests/test-ui-components/src/labicon.spec.ts

@@ -0,0 +1,14 @@
+// Copyright (c) Jupyter Development Team.
+// Distributed under the terms of the Modified BSD License.
+
+import { expect } from 'chai';
+
+import { LabIcon } from '../..//ui-components/icon';
+
+describe('@jupyterlab/nbformat', () => {
+  describe('validateIcons', () => {
+    it('should return true for a valid json object', () => {
+      // expect('application/json', { foo: 1 }).to.equal(true);
+    });
+  });
+});

+ 15 - 0
tests/test-ui-components/tsconfig.json

@@ -0,0 +1,15 @@
+{
+  "extends": "../../tsconfigbase",
+  "compilerOptions": {
+    "outDir": "build",
+    "rootDir": "src",
+    "types": ["jest"],
+    "composite": false
+  },
+  "include": ["src/*"],
+  "references": [
+    {
+      "path": "../../packages/test-ui-components"
+    }
+  ]
+}