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