Skip to content

Commit

Permalink
fix(dep): Bump useragent to fix HeadlessChrome version
Browse files Browse the repository at this point in the history
Bump useragent 2.3.0 to pull in ua-parser/uap-core#263 in which Headless Chrome version detected to be 0.0.0.
Update tests to reflect latest useragent OS major version string identifiers.
Fixes karma-runner#2762
  • Loading branch information
rkuzsma committed Nov 3, 2018
1 parent 361aa3f commit e6421b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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
18 changes: 13 additions & 5 deletions test/unit/helper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path')
describe('helper', () => {
const helper = require('../../lib/helper')

describe('browserFullNameToShort', () => {
describe.only('browserFullNameToShort', () => {
// helper function
const expecting = (name) => expect(helper.browserFullNameToShort(name))

Expand Down 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 e6421b1

Please sign in to comment.