material-svelte / vite-web-test-runner-plugin

MIT License
39 stars 13 forks source link

Prevent "[vite] connecting..." logs #7

Closed IanVS closed 3 years ago

IanVS commented 3 years ago

I think I've gotten my tests running correctly, but for every test, I see:

 🚧 Browser logs:
      [vite] connecting...
      [vite] connected.

Is it possible to silence those? I've tried logLevel: 'silent' in my vite.config.ts, with no luck.

IanVS commented 3 years ago

I think this is an issue in vite, and have opened an issue there. https://github.com/vitejs/vite/issues/3641

betaboon commented 3 years ago

thanks for letting us know and looking into it. I would reopen this issue to keep track of it ;)

IanVS commented 3 years ago

It's possible to use the filterBrowserLogs option from web-test-runner to ignore these messages.

filterBrowserLogs: ({ args }) => {
      if (args[0] === '[vite] connecting...' || args[0] === '[vite] connected.') return false;

      return true;
}

Would you like a PR that adds something like this (maybe cleaned up a bit) to the examples?

betaboon commented 3 years ago

thanks for following up. merged ;)