Giter VIP home page Giter VIP logo

Comments (4)

AriPerkkio avatar AriPerkkio commented on May 29, 2024

In the reproduction case is it this console.log that's not showing up? https://github.com/peterbe/vitest-ts-and-http/blob/0a29689c5282234d4cd31b09c4f2a3eabbb5075c/src/server.ts#L17

Does it help if you await until the server is created?

from vitest.

peterbe avatar peterbe commented on May 29, 2024

In the reproduction case is it this console.log that's not showing up? https://github.com/peterbe/vitest-ts-and-http/blob/0a29689c5282234d4cd31b09c4f2a3eabbb5075c/src/server.ts#L17

That console log is fine.
It's this: https://github.com/peterbe/vitest-ts-and-http/blob/8525d03322fb0fa56ed3fe6316c7638314c83d65/src/server.ts#L13 that the eyes can't see.
I think what happens is that the default reporter clears the screen when it comes time to show the test run summary.

from vitest.

AriPerkkio avatar AriPerkkio commented on May 29, 2024

Right, that wasn't on the original reproduction case I think.

This logging happens on the main thread as it's coming from setup file. It also happens during the test run. If it was coming from the test files, Vitest would be able to intercept it and show it correctly in the logs. I'm not sure if we even can capture logs that are coming outside test files. 🤔

You could use --reporter basic here to force CI's reporter. That one doesn't clear screen during test run.

from vitest.

peterbe avatar peterbe commented on May 29, 2024

Hmm.. --reporter basic is pretty good. It's kinda like setting CI=1.

Without

Vitest run

With --reporter basic

Vitest run

(This demonstrates the console.log happening within the handlers of the server started by vitest)

I guess it's not so basic after all. It's got color. It has a neat table.

It makes me wonder, why did I not try --reporter basic? And why did --clearScreen=false not work?
Perhaps there's nothing to do here but be aware that --reporter=basic might be the right solution for others in the similar situation.

from vitest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.