From 240209f738df69a9e382e04d8c59f020b34c3267 Mon Sep 17 00:00:00 2001 From: Rich Kuzsma Date: Mon, 5 Nov 2018 10:41:35 -0500 Subject: [PATCH] fix(dep): Bump useragent to fix HeadlessChrome version (#3201) Fixes #2762 --- package.json | 2 +- test/unit/helper.spec.js | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ebbb9ea72..b3877257d 100644 --- a/package.json +++ b/package.json @@ -395,7 +395,7 @@ "socket.io": "2.1.1", "source-map": "^0.6.1", "tmp": "0.0.33", - "useragent": "2.2.1" + "useragent": "2.3.0" }, "devDependencies": { "LiveScript": "^1.3.0", diff --git a/test/unit/helper.spec.js b/test/unit/helper.spec.js index 3cabf4a1c..65651dac2 100644 --- a/test/unit/helper.spec.js +++ b/test/unit/helper.spec.js @@ -75,7 +75,7 @@ describe('helper', () => { 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; ' + '.NET CLR 2.0.50727; .NET4.0C; .NET4.0E)' ) - .to.be.equal('IE 7.0.0 (Windows Vista 0.0.0)') + .to.be.equal('IE 7.0.0 (Windows Vista.0.0)') }) it('should parse IE8', () => { @@ -83,7 +83,7 @@ describe('helper', () => { 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; ' + 'SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)"' ) - .to.be.equal('IE 8.0.0 (Windows 7 0.0.0)') + .to.be.equal('IE 8.0.0 (Windows 7.0.0)') }) it('should parse IE9', () => { @@ -91,7 +91,7 @@ describe('helper', () => { 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; ' + '.NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)' ) - .to.be.equal('IE 9.0.0 (Windows 7 0.0.0)') + .to.be.equal('IE 9.0.0 (Windows 7.0.0)') }) it('should parse IE10', () => { @@ -99,7 +99,7 @@ describe('helper', () => { 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; ' + '.NET4.0E; .NET4.0C)' ) - .to.be.equal('IE 10.0.0 (Windows 8 0.0.0)') + .to.be.equal('IE 10.0.0 (Windows 8.0.0)') }) it('should parse PhantomJS', () => { @@ -118,6 +118,14 @@ describe('helper', () => { ) .to.be.equal('Android 4.2.0 (Android 4.2.0)') }) + + it('should parse Headless Chrome', () => { + expecting( + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) ' + + 'HeadlessChrome/70.0.3538.77 Safari/537.36' + ) + .to.be.equal('HeadlessChrome 70.0.3538 (Linux 0.0.0)') + }) }) describe('isDefined', () => {