diff --git a/src/node/runner.js b/src/node/runner.js index 35b89c82..f33eabf3 100644 --- a/src/node/runner.js +++ b/src/node/runner.js @@ -140,6 +140,7 @@ export class NodeRunner { } catch { await this.stop(true, 'Tests failed.') } + this.stop(false, 'Tests passed.') } async watch() { diff --git a/src/runner.js b/src/runner.js index 4f6040d8..6afa4d3f 100644 --- a/src/runner.js +++ b/src/runner.js @@ -4,7 +4,6 @@ import { mkdirSync } from 'fs' import path from 'path' import { fileURLToPath } from 'node:url' import { asyncExitHook, gracefulExit } from 'exit-hook' -import ora from 'ora' import { nanoid } from 'nanoid' import { temporaryDirectory } from 'tempy' import { premove } from 'premove/sync' @@ -299,7 +298,6 @@ export class Runner { this.beforeTestsOutput = await this.options.beforeTests(this.options) - const spinner = ora(`Setting up ${this.options.browser}`).start() try { // Setup the context const context = await this.setupContext() @@ -311,7 +309,7 @@ export class Runner { // Setup page const page = await this.setupPage(context) - spinner.succeed(`${this.options.browser} set up`) + log.info(`Browser "${this.options.browser}" setup complete.`) const { outName } = await this.runTests(page) @@ -349,10 +347,12 @@ export class Runner { } // exit - await this.stop(testsFailed) + await this.stop( + testsFailed, + testsFailed ? 'Tests failed.' : 'Tests passed.' + ) } } catch (/** @type {any} */ error) { - spinner.fail('Running tests failed.') await this.stop(true, error) } } @@ -388,20 +388,18 @@ export class Runner { }) this.beforeTestsOutput = await this.options.beforeTests(this.options) - const spinner = ora(`Setting up ${this.options.browser}`).start() // Setup the context const context = await this.setupContext() // Run the before script if (this.options.before) { - spinner.text = 'Running before script' await this.setupBeforePage(context) } // Setup page const page = await this.setupPage(context) - spinner.succeed(`${this.options.browser} set up`) + log.info(`Browser "${this.options.browser}" setup complete.`) const { files } = await this.runTests(page) @@ -431,7 +429,7 @@ export class Runner { // Run after tests hook await this.options.afterTests(this.options, this.beforeTestsOutput) - await premove(this.dir) + premove(this.dir) const serverClose = new Promise((resolve, reject) => { if (this.server) { diff --git a/src/taps/harness.js b/src/taps/harness.js index 0ddc00f6..f7481b36 100644 --- a/src/taps/harness.js +++ b/src/taps/harness.js @@ -68,7 +68,7 @@ function log(ctx, fail, time) { ? kleur.red('✘') : ctx.skip ? kleur.yellow('-') - : kleur.green('✓') + : kleur.green('✔') const _time = kleur.gray(`(${time})`) const _msg = `${ctx.suite ? ctx.suite + ' > ' : ''}${ctx.name}` diff --git a/src/utils/index.js b/src/utils/index.js index 35ddb017..31696955 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -67,7 +67,7 @@ export const log = { */ warn(message, quiet = false) { if (!quiet) { - console.warn(kleur.yellow('⚠'), message) + console.warn(kleur.yellow('-'), message) } }, /** @@ -76,7 +76,7 @@ export const log = { */ error(message, quiet = false) { if (!quiet) { - console.warn(kleur.red('✖'), message) + console.warn(kleur.red('✘'), message) } }, /**