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.pswp.cn/news/395556.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/395556.shtml
英文地址,請注明出處:http://en.pswp.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…