Steven Silvester hace 6 años
padre
commit
f096347a78
Se han modificado 2 ficheros con 15 adiciones y 6 borrados
  1. 12 4
      jupyterlab/tests/test_app.py
  2. 3 2
      tests/test-services/src/kernel/ikernel.spec.ts

+ 12 - 4
jupyterlab/tests/test_app.py

@@ -177,8 +177,12 @@ class ProcessTestApp(ProcessApp):
 
 jest_aliases = dict(base_aliases)
 jest_aliases.update({
-    'pattern': 'JestApp.testPathPattern'
+    'testPathPattern': 'JestApp.testPathPattern'
 })
+jest_aliases.update({
+    'testNamePattern': 'JestApp.testNamePattern'
+})
+
 
 jest_flags = dict(base_flags)
 jest_flags['coverage'] = (
@@ -198,6 +202,8 @@ class JestApp(ProcessTestApp):
 
     testPathPattern = Unicode('').tag(config=True)
 
+    testNamePattern = Unicode('').tag(config=True)
+
     watchAll = Bool(False).tag(config=True)
 
     aliases = jest_aliases
@@ -226,15 +232,18 @@ class JestApp(ProcessTestApp):
         elif debug:
             cmd += ['node', '--inspect-brk', jest,  '--no-cache']
             if self.watchAll:
-                cmd += [' --watchAll']
+                cmd += ['--watchAll']
             else:
-                cmd += [' --watch']
+                cmd += ['--watch']
         else:
             cmd += [jest]
 
         if self.testPathPattern:
             cmd += ['--testPathPattern', self.testPathPattern]
 
+        if self.testNamePattern:
+            cmd += ['--testNamePattern', self.testNamePattern]
+
         cmd += ['--runInBand']
 
         if self.log_level > logging.INFO:
@@ -322,7 +331,6 @@ class KarmaTestApp(ProcessTestApp):
 def run_jest(jest_dir):
     """Run a jest test in the given base directory.
     """
-    logging.disable(logging.WARNING)
     app = JestApp.instance()
     app.jest_dir = jest_dir
     app.initialize()

+ 3 - 2
tests/test-services/src/kernel/ikernel.spec.ts

@@ -526,6 +526,7 @@ describe('Kernel.IKernel', () => {
       const msg = KernelMessage.createShellMessage(options);
       expect(() => {
         kernel.sendShellMessage(msg, true);
+        expect(false).to.equal(true);
       }).to.throw(/Kernel is dead/);
       await tester.shutdown();
       tester.dispose();
@@ -707,7 +708,7 @@ describe('Kernel.IKernel', () => {
       await expectFailure(shutdown, '');
     });
 
-    it('should fail if the kernel is dead', async () => {
+    it('should still pass if the kernel is dead', async () => {
       const tester = new KernelTester();
       const kernel = await tester.start();
 
@@ -717,7 +718,7 @@ describe('Kernel.IKernel', () => {
       });
       tester.sendStatus(UUID.uuid4(), 'dead');
       await dead;
-      await expectFailure(kernel.shutdown(), 'Kernel is dead');
+      await kernel.shutdown();
       tester.dispose();
     });