Skip to content

No log output #1844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
electerious opened this issue Jun 16, 2018 · 3 comments
Closed

No log output #1844

electerious opened this issue Jun 16, 2018 · 3 comments

Comments

@electerious
Copy link

electerious commented Jun 16, 2018

Description

I try to log values for debugging with t.log and console.log, but they're not showing up in the terminal.

Test Source

'use strict'

const test = require('ava')

test('something', (t) => {

	t.log('1')
	t.log('2')
	console.log('3')
	
	t.pass()

})

Error Message & Stack Trace

$ ava


  1 tests passed

Sometimes:

$ ava

⠸ 3

  1 tests passed

Config

Copy the relevant section from package.json:

{
  "ava": {
    "babel": false,
    "compileEnhancements": false
  }
}

Command-Line Arguments

ava

Environment

Node.js v10.4.0
darwin 17.6.0
ava 1.0.0-beta.5.1
npm 6.1.0
@novemberborn
Copy link
Member

I assume this is because the default reporter only shows details for failed tests. The logs should show up if you use npx ava --verbose.

Though I would have expected console.log() to show, it's asynchronous so perhaps the worker exits before it's read. I'm looking to make some changes to the reporters that should make this more reliable, see #1776.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

@krisnye
Copy link

krisnye commented Apr 27, 2019

console.log should always show up by default. This is bad behavior. When we add a console.log we always expect to be able to see it.

@zimtsui
Copy link

zimtsui commented Jul 10, 2019

I assume this is because the default reporter only shows details for failed tests. The logs should show up if you use npx ava --verbose.

Though I would have expected console.log() to show, it's asynchronous so perhaps the worker exits before it's read. I'm looking to make some changes to the reporters that should make this more reliable, see #1776.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

it works, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants