Skip to content

Commit

Permalink
fix(dep): Bump useragent to fix HeadlessChrome version (#3201)
Browse files Browse the repository at this point in the history
Fixes #2762
  • Loading branch information
rkuzsma authored and johnjbarton committed Nov 5, 2018
1 parent 361aa3f commit 240209f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 12 additions & 4 deletions test/unit/helper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,31 @@ 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', () => {
expecting(
'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', () => {
expecting(
'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', () => {
expecting(
'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', () => {
Expand All @@ -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', () => {
Expand Down

0 comments on commit 240209f

Please sign in to comment.