mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Merge pull request #18788 from atom/aw/jasmine-reporter
Use a custom Jasmine reporter to actually show spec names
This commit is contained in:
commit
0c29022aec
@ -15,7 +15,7 @@ matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: trusty
|
||||
env: NODE_VERSION=8.9.3 DISPLAY=:99.0 CC=clang CXX=clang++ npm_config_clang=1
|
||||
env: NODE_VERSION=8.9.3 DISPLAY=:99.0 CC=clang CXX=clang++ npm_config_clang=1 ATOM_JASMINE_REPORTER=list
|
||||
|
||||
sudo: required
|
||||
|
||||
|
@ -19,6 +19,7 @@ platform:
|
||||
environment:
|
||||
global:
|
||||
ATOM_DEV_RESOURCE_PATH: c:\projects\atom
|
||||
ATOM_JASMINE_REPORTER: list
|
||||
TEST_JUNIT_XML_ROOT: c:\projects\junit-test-results
|
||||
NODE_VERSION: 8.9.3
|
||||
|
||||
|
@ -24,6 +24,7 @@ jobs:
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
ATOM_JASMINE_REPORTER: list
|
||||
displayName: Run tests
|
||||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
||||
|
||||
|
@ -44,6 +44,7 @@ jobs:
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
ATOM_JASMINE_REPORTER: list
|
||||
displayName: Run tests
|
||||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
||||
|
||||
|
@ -69,6 +69,7 @@ jobs:
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
ATOM_JASMINE_REPORTER: list
|
||||
BUILD_ARCH: $(buildArch)
|
||||
displayName: Run tests
|
||||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
||||
|
35
spec/jasmine-list-reporter.js
Normal file
35
spec/jasmine-list-reporter.js
Normal file
@ -0,0 +1,35 @@
|
||||
const {TerminalReporter} = require('jasmine-tagged')
|
||||
|
||||
class JasmineListReporter extends TerminalReporter {
|
||||
fullDescription (spec) {
|
||||
let fullDescription = spec.description
|
||||
let currentSuite = spec.suite
|
||||
while (currentSuite) {
|
||||
fullDescription = currentSuite.description + ' > ' + fullDescription
|
||||
currentSuite = currentSuite.parentSuite
|
||||
}
|
||||
return fullDescription
|
||||
}
|
||||
|
||||
reportSpecStarting (spec) {
|
||||
this.print_(this.fullDescription(spec) + ' ')
|
||||
}
|
||||
|
||||
reportSpecResults (spec) {
|
||||
const result = spec.results()
|
||||
if (result.skipped) {
|
||||
return
|
||||
}
|
||||
|
||||
let msg = ''
|
||||
if (result.passed()) {
|
||||
msg = this.stringWithColor_('[pass]', this.color_.pass())
|
||||
} else {
|
||||
msg = this.stringWithColor_('[FAIL]', this.color_.fail())
|
||||
this.addFailureToFailures_(spec)
|
||||
}
|
||||
this.printLine_(msg)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { JasmineListReporter }
|
@ -94,8 +94,7 @@ buildTerminalReporter = (logFile, resolveWithExitCode) ->
|
||||
else
|
||||
ipcRenderer.send 'write-to-stderr', str
|
||||
|
||||
{TerminalReporter} = require 'jasmine-tagged'
|
||||
new TerminalReporter
|
||||
options =
|
||||
print: (str) ->
|
||||
log(str)
|
||||
onComplete: (runner) ->
|
||||
@ -109,3 +108,10 @@ buildTerminalReporter = (logFile, resolveWithExitCode) ->
|
||||
resolveWithExitCode(1)
|
||||
else
|
||||
resolveWithExitCode(0)
|
||||
|
||||
if process.env.ATOM_JASMINE_REPORTER is 'list'
|
||||
{JasmineListReporter} = require './jasmine-list-reporter'
|
||||
new JasmineListReporter(options)
|
||||
else
|
||||
{TerminalReporter} = require 'jasmine-tagged'
|
||||
new TerminalReporter(options)
|
||||
|
Loading…
Reference in New Issue
Block a user