javascript控制台

by Shakeel Mohamed

Shakeel Mohamed着

如何使您JavaScript控制台静音 (How to silence your JavaScript console)

Here’s a helpful tip for silencing your browser’s JavaScript console.

这是使浏览器JavaScript控制台静音的有用提示。

This enables you to unit test with 100% code coverage, while maintaining a clean test output on the console.

这使您能够以100%的代码覆盖率进行单元测试,同时在控制台上保持干净的测试输出。

First you need some basic setup code:

首先,您需要一些基本的设置代码:

Then, you can write code using mute() and unmute() like so:

然后,您可以像下面这样使用Mutate()unmute()编写代码:

This article originally appeared on Coderwall.

本文最初出现在Coderwall上

翻译自: https://www.freecodecamp.org/news/how-to-silence-your-javascript-console-8fcdd96997f7/

javascript控制台

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐