Comments (4)
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.
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.
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.
Hmm.. --reporter basic
is pretty good. It's kinda like setting CI=1
.
Without
With --reporter basic
(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)
- Add support for Node.js 20 `--env-file` flag HOT 6
- vitest fails to load typescript worker code in node (but does so correctly in browser mode) HOT 6
- Better output in UI mode for screen.debug() HOT 2
- ReferenceError on globals using Vitest HOT 2
- Additional type definitions are ignored
- Second (Custom Message) Argument Breaks expect().toBeVisible() HOT 2
- Missing link in Documentation mocking requests HOT 1
- vi.stubEnv documentation and typing differ from each other
- `MY_ENV=abc vitest` exposes `import.meta.env.MY_ENV === "abc"` HOT 2
- Support it() as well for bench HOT 2
- Vitest 1.6.0 upgrade breaks sandboxing the filesystem from tests HOT 1
- Interactivity API for Browser Mode
- Getting "Error: No test suite found in file ..." using basic test example HOT 1
- TypeError on the Debugger after assigning a `Set` in a constructor
- Invalid coverage report for Typescript Member Visibility Keywords (V8) HOT 2
- Allow changing viewport in browser mode
- Error: Expected a single value for option `--exclude <glob>`, received `["a/*", "b/*"]` HOT 1
- Allow augmentation of `env` in the `InlineConfig` interface for type-safe env vars, HOT 2
- coverage-v8 reports incorrect coverage when using multiple environments
- vitest config with react plugin typescript error: "No overload matches this call" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitest.