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/

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

  1. chrome浏览器的跨域设置 Google Chrome浏览器下开启禁用缓存和js跨域限制--disable-web-security...

    chrome用户默认路径 Win7:C:\Users\[用户名]\AppData\Local\Google\Chrome\User Data\ XP:C:\Documents and Settings ...

  2. Google Chrome浏览器必备的20个插件

    Google Chrome浏览器虽然与火狐浏览器有所区别,不过他们都是很开放的浏览器产品,所以也有许多有用的插件,这些插件对于日常生活与网络冲浪都很有用,比如网银,炒股等. Google Chrome ...

  3. 如何在Google Chrome浏览器中启动JavaScript调试器?

    使用Google Chrome浏览器时,我想调试一些JavaScript代码. 我怎样才能做到这一点? #1楼 在Chrome浏览器中按F12功能键以启动JavaScript调试器,然后单击" ...

  4. 作为Web开发人员,我为什么喜欢Google Chrome浏览器

    在Google Chrome浏览器出来之前,我一直使用FireFox,因为FireFox的插件非常丰富,更因为FireFox有强大的Firebug,对于前端开发可谓神器. 在Chrome出来的时候,我 ...

  5. 如何在Kali Linux中安装Google Chrome浏览器

    介绍 目的 我们的目标就是在 Kali Linux 上安装好 Google Chrome Web 浏览器.同时,请参阅附录为可能出现的问题进行排查. 要求 需要获得已安装 Kali Linux 或者 ...

  6. linux chrome 管理员,Linux下google chrome浏览器flash无法启用的解决

    在Linux下使用google chrome浏览器却碰到flash无法启用的问题,以下是解决方法. 错误提示 提示正在为您加载视频...您没有安装flashplayer,请到www.adobe.com ...

  7. chrome 固定缩放比例_您如何调整Google Chrome浏览器的用户界面缩放比例?

    chrome 固定缩放比例 Everything can be going along nicely until a program gets a new update that suddenly t ...

  8. 【谷歌】Google Chrome 浏览器中 font-size 12px 没有效果

    Google Chrome 浏览器中 font-size < 12px 没有效果 解决方法: *{-webkit-text-size-adjust: none;} 此功能立竿见影,目的是去掉CH ...

  9. 不能以根用户身份运行 Google Chrome 浏览器

    在fedora12中安装了chrome浏览器,但是一运行出现以下提示: 不能以根用户身份运行 Google Chrome 浏览器.请以普通用户身份启动"Google Chrome 浏览器&q ...

最新文章

  1. macos下 python安装cx_oracle
  2. python列表取出元素_python中的列表,添加元素,获取元素,删除元素,列表分片,常用操作符...
  3. Linux Rootkit 系列五:感染系统关键内核模块实现持久化
  4. Qt/C++工作笔记-对vector与QVector中erase操作的进一步认识(区别与联系)
  5. TensorFlow 第一步 开门见山:Hello World!
  6. ImportError: cannot import name ‘activations‘ from ‘keras.layers‘
  7. windows屏幕放大镜
  8. outlook qr码在哪里_QR和条码扫描仪app下载|QR和条码扫描仪安卓版下载_v10.00.3
  9. mysql_front安装_MySql5.5安装步骤及MySql_Front视图配置
  10. 小猫爪:i.MX RT1050学习笔记24-eDMA之eDMASAIASRC的“纠缠”(RT1170)
  11. Win10系统 禁止某个程序\软件联网
  12. 数据库练习题(比较基础)
  13. vue-生成二维码【生成、点击输入框内叉号移除生成的二维码、输入框聚焦】
  14. mysql定时任务自动备份
  15. 英语日常口语对话(7)
  16. 四六级重要单词(三)
  17. python变量的存储机制,关于python:python的变量缓存机制
  18. 在第四代计算机期间内,计算机的应用逐步进入到,在第四代计算机期间内,计算机的应用逐步进入到.docx.docx...
  19. ZYNQ LINUX开发笔记——内存直接访问
  20. 历史上著名的三次崩盘

热门文章

  1. 系统学Android从零开始,详细的Android学习指南
  2. 阿里P8面试官都说太详细了,面试资料分享
  3. Codeforces 600E Lomsat gelral (树上启发式合并)
  4. 转载: java telnet ssh 实现
  5. 24小时制时间格式和12小时制时间格式
  6. Unity3D 自动打包整个项目(以AssetBundle实现)
  7. Lecture 14 Competive Analysis
  8. Asp导出到Excel之二
  9. 随便说说:在ASP.NET应用程序中上传文件
  10. shell 字符串分割