diff --git a/.travis.yml b/.travis.yml index f5a6ae3a9..e0232b652 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/appveyor.yml b/appveyor.yml index 7e5c07b10..a30ba543a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/script/vsts/platforms/linux.yml b/script/vsts/platforms/linux.yml index 04a723ed7..eb70878c7 100644 --- a/script/vsts/platforms/linux.yml +++ b/script/vsts/platforms/linux.yml @@ -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')) diff --git a/script/vsts/platforms/macos.yml b/script/vsts/platforms/macos.yml index 55eb3b387..005f8b96f 100644 --- a/script/vsts/platforms/macos.yml +++ b/script/vsts/platforms/macos.yml @@ -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')) diff --git a/script/vsts/platforms/windows.yml b/script/vsts/platforms/windows.yml index 77df8a3a2..8f490b77c 100644 --- a/script/vsts/platforms/windows.yml +++ b/script/vsts/platforms/windows.yml @@ -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')) diff --git a/spec/jasmine-list-reporter.js b/spec/jasmine-list-reporter.js new file mode 100644 index 000000000..b6976b6ca --- /dev/null +++ b/spec/jasmine-list-reporter.js @@ -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 } diff --git a/spec/jasmine-test-runner.coffee b/spec/jasmine-test-runner.coffee index e6c594cef..ef76d346d 100644 --- a/spec/jasmine-test-runner.coffee +++ b/spec/jasmine-test-runner.coffee @@ -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)