Google Chrome浏览器可能在您不知情的情况下破坏了您的测试

by Robert Axelsen

罗伯特·阿克森(Robert Axelsen)

Google Chrome浏览器可能在您不知情的情况下破坏了您的测试 (Google Chrome might have broken your tests without you even knowing about it)

My colleague just discovered that Chrome 58 (released April 19th) has silently muted all console.debug() output in their Chrome Dev Tools.

我的同事刚刚发现Chrome 58(于4月19日发布)已在其Chrome开发工具中静默静音了所有console.debug()输出。

How? By making changes to the Console UI, from filtering based on type of console method to filtering based on levels.

怎么样? 通过更改控制台UI ,从基于控制台方法类型的筛选到基于级别的筛选。

Introducing levels is not a bad thing in and of itself. But Google also chose to stop showing all console output by default. Now you can only see level “Info” and below.

引入级别本身并不是一件坏事。 但是Google默认也选择停止显示所有控制台输出。 现在,您只能看到“信息”及以下级别。

Depending on your project, it might also be a big deal to no longer be able to filter by showing only one console method’s output.

根据您的项目,可能不再通过仅显示一个控制台方法的输出进行过滤也很重要。

For example only console.log(). This is particularly troublesome if you’re working on a larger project with hundreds of different types of output mixed together.

例如仅console.log() 。 如果您正在处理一个大型项目,将数百种不同类型的输出混合在一起,则这尤其麻烦。

As you can see from the comments section in the release notes, this has not been received well by developers.

从发行说明的注释部分可以看出,开发人员对此并不满意。

测试失败 (Failing Tests)

This means that if your app or project relies on console.debug() level output for testing, your tests might have been failing for over a month without you even noticing.

这意味着如果您的应用程序或项目依赖console.debug()级别的输出进行测试,则您的测试可能已经失败了一个多月,甚至没有引起您的注意。

All without so much as a pop-up warning from Google.

所有这些都没有来自Google的弹出警告。

By making logging non-verbose by default, I believe Google has broken with best practice here, and made a huge mistake.

通过默认将日志记录设置为非冗长,我相信Google违反了此处的最佳做法,并犯了一个严重错误。

Also, removing the ability to only show output based on a specific console method has resulted in a worsened workflow for many developers.

此外,删除仅基于特定控制台方法显示输出的功能也导致许多开发人员的工作流程变糟。

自己测试一下 (Test it out for yourself)

I did some testing with the following console methods in Chrome Dev Tools:

我使用Chrome开发工具中的以下控制台方法进行了一些测试:

console.assert(true, {assert: "assert"});console.count('count');console.debug('debug');console.dir({dir: "dir"});console.error('error');console.info('info');console.log('log');console.profile('profile');setTimeout(function(){ console.profileEnd('profile'); }, 1000);console.table('table');console.time('time');setTimeout(function(){ console.timeEnd('time'); }, 1000);console.timeStamp('timeStamp');console.trace('trace');console.warn('warn');

You can simply copy paste this into the console in Chrome Dev Tools, hit enter, and change the filter level to see what is displayed in which level.

您可以简单地将其复制粘贴到Chrome Dev Tools中的控制台中,按Enter,然后更改过滤器级别以查看哪个级别显示了什么。

一些截图说明 (Some Screenshots To Illustrate)

Here are some screenshots to illustrate the differences between levels. Notice especially the first screenshot of default “Info” level, and the fact that “3 items are hidden.”

以下是一些屏幕截图,用于说明各个级别之间的差异。 特别要注意默认“信息”级别的第一张屏幕截图,以及“隐藏了3个项目”这一事实。

有什么想法吗? (Have Any Thoughts?)

What do you think about this change? Was Google in the wrong for making this change? Or do you think it was an improvement to the “Console UI” overall? Please leave a comment below.

您如何看待这种变化? Google做出此更改错了吗? 还是您认为这是对“控制台UI”整体的改进? 请在下面发表评论。

This article was originally published on “Hello, I Love Code” and is written by Robert Axelsen, who is a JavaScript Developer, Meetup Organizer and Open Source enthusiast based in Austria, Europe.

本文最初发表在“你好,我爱代码”上 ,由罗伯特·阿克塞尔森 ( Robert Axelsen )撰写,他是JavaScript开发人员,Meetup组织者和开放源代码爱好者,来自欧洲奥地利。

You can connect with Robert on Twitter, or get to know him better by visiting his website.

您可以在Twitter上与Robert联系,或者通过访问他的网站来更好地了解他。

翻译自: https://www.freecodecamp.org/news/google-chrome-might-have-broken-your-tests-without-you-even-knowing-about-it-9d9130a6fd0c/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/395556.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java 9 将采用新的版本字符串格式

在现有的版本编码格式使用了两年之后,从Java 9开始,Java版本方案将根据业内软件版本编码的最佳实践进行修改。使用或解析Java版本字符串的应用程序开发人员要注意了,因为这种变化可以会影响他们的应用程序。 正如JEP 223所阐述的那样&#xf…

oracle 表更新表,Oracle 更新表(另一张表)

JUC学习笔记--Thread多线程基础实现多线程的两种方法 java 实现多线程通过两种方式1.继承Thread类 ,2.实现Runnable接口 class Newthead extends Thread{ public void ru ...SharePoint中新创建的Web Application在浏览器中报404错误问题描述:在安装完成SharePoint 2010后,进入…

jQuery(爱前端)

一 jQuery 简介 官网:www.jquery.com 口号:写更少的代码,做更多的事情 jQuery 是一个快速、小型的、特性很多的JS库,它把很多事儿都变得简单。jQuery是免费的、开源的。 jQuery 是 DOM 编程领域的霸主,极大的简化了原生…

跳过 centos部署 webpy的各种坑

用centos部署webpy发现的各种坑: 1、python 版本: 2、中文编码: 3、web模块路径: 在命令行里输入python,能import web,但是网站错误报告一直报告没有找到web模块,说明web模块路径有问题。python…

撰写本文的所有基本React.js概念

Update: This article is now part of my book “React.js Beyond The Basics”.更新:本文现在是我的书《超越基础的React.js》的一部分。 Read the updated version of this content and more about React at jscomplete.com/react-beyond-basics.在jscomplete.com…

CentOS 7 firewalld使用简介

2019独角兽企业重金招聘Python工程师标准>>> Centos升级到7之后,发现无法使用iptables控制Linuxs的端口,google之后发现Centos 7使用firewalld代替了原来的iptables。下面记录如何使用firewalld开放Linux端口: 1.快速使用说明 开启…

简述java语言的特点

简述java语言的特点: ① 简单的特性 ② 面向对象的特性 ③ 分布式处理的特性 ④ 健壮的特性 ⑤ 结构中立的特性 ⑥ 安全特性 ⑦ 可移植的特性 ⑧ 解释的特性 ⑨ 高性能的特性 ⑩ 多线程的特性 转载于:https://www.cnblogs.com/qq1335…

php函数嵌套 作用域,javascript 嵌套的函数(作用域链)_javascript技巧

嵌套的函数(作用域链)当你进行函数的嵌套时,要注意实际上作用域链是发生变化的,这点可能看起来不太直观。你可把下面的代码置入firebug监视值的变化。var testvar window属性;var o1 {testvar:1, fun:function(){alert(o1: this.testvaro1.fun();1o2.f…

【C#-枚举】枚举的使用

枚举是用户定义的整数类型。 namespace ConsoleApplication1 {/// <summary>/// 在枚举中使用一个整数值&#xff0c;来表示一天的阶段/// 如&#xff1a;TimeOfDay.Morning返回数字0/// </summary>class EnumExample{public enum TimeOfDay{Morning 0,Afternoon …

Elixir 初尝试 5 -- 遇见Actor

Actor模型的定义 wiki如是说 The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: …

创建外部快照_快照事件:现在如何仅通过拍照即可创建日历事件

创建外部快照by Arjun Krishna Babu通过Arjun Krishna Babu 快照事件&#xff1a;现在如何仅通过拍照即可创建日历事件 (Snap Event: How you can now create calendar events just by taking a picture) Google just published my first Android app, Snap Event, in their P…

一个备份sql server文件.bak还原成两个数据库

一直对这个概念很模糊&#xff0c;今天具体一点。 备份文件只要是正常的.bak文件就好。 数据库>还原数据库 直接填写还原之后的文件名就行。 用一份备份文件还原两个一样的库&#xff0c;只是名称不一样。 转载于:https://www.cnblogs.com/Ly426/p/10209825.html

linux服务器防病毒,Linux系统中你不需要防病毒?_服务器评论-中关村在线

误区4&#xff1a;Linux是无病毒。Linux的安全性这么好&#xff0c;这是否意味着Linux是无病毒吗&#xff1f;现实&#xff1a;Linux是非常安全&#xff0c;并不是没有针对Linux方面的病毒。有许多针对Linux的已知病毒。但是几乎所有的已知病毒对于Linux在本质上都是非破坏性的…

外置接口请求

1. 请求接口 /*** 请求接口** param url* param paramsStr* param type Connection.Method.POST* param heads* return*/ public JSONObject sendUpload(String url, String paramsStr, Connection.Method type, Map<String, String> heads) {//发送上传订单请求Str…

python面向对象-1方法、构造函数

类是指&#xff1a;描述一种事物的定义&#xff0c;是个抽象的概念 实例指&#xff1a;该种事物的一个具体的个体&#xff0c;是具体的东西 打个比方&#xff1a; “人”是一个类。“张三”是人类的一个具体例子 在编程时也是同样的道理&#xff0c;你先自己定义一个“类”&am…

bzoj3503: [Cqoi2014]和谐矩阵

高斯消元解异或方程组。学了bitset。对比如下 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; #define REP(i,s,t) for(int is;i<t;i) #define dwn(i,s,t) for(int is;i>t;i--) #define clr(…

她偏爱雏菊一样的淡黄色_为什么开源项目(非常)偏爱新用户,以及您可以采取什么措施...

她偏爱雏菊一样的淡黄色by Filip Hracek由Filip Hracek 为什么开源项目(非常)偏爱新用户&#xff0c;以及您可以采取什么措施 (Why open source projects (sadly) favor new users, and what you can do about it) Every now and then, all developer products (SDKs, framewo…

linux 脚本 expected,Linux | shell与expect结合使用

在linux操作系统下&#xff0c;使用脚本自动化&#xff0c;一般由两种方案。方案一&#xff1a;telnetftp方案二&#xff1a;sshscpexpect。以下主要使用sshscpexpect为例进行说明使用方式。第一步&#xff1a;安装expect&#xff1a;yum -y install expect第二步&#xff1a;验…

[Swift]LeetCode246.对称数 $ Strobogrammatic Number

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号&#xff1a;山青咏芝&#xff08;shanqingyongzhi&#xff09;➤博客园地址&#xff1a;山青咏芝&#xff08;https://www.cnblogs.com/strengthen/&#xff09;➤GitHub地址&a…

C++中父类的虚函数必需要实现吗?

一、情景 C中父类的虚函数必需要实现吗&#xff1f; class Vir{ public:virtual void tryVirtual(); };class CVir:public Vir{ public:void tryVirtual(){std::cout<<"CVir"<<std::endl;} };二、说明 &#xff08;1&#xff09;在main函数中&#xff0c…