1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Fix nyc misconfiguration

This commit is contained in:
Denis Demchenko 2018-06-30 19:21:09 +03:00
parent 107069b845
commit 3530ca1c70
5 changed files with 1906 additions and 3 deletions

View File

@ -1,3 +1,9 @@
{ {
"presets": ["env"] "presets": ["env"],
"env": {
"test": {
"plugins": [ "istanbul" ],
"presets": [["env", { "targets": { "node": "current" } }]]
}
}
} }

4
.nycrc Normal file
View File

@ -0,0 +1,4 @@
{
"sourceMap": false,
"instrument": false
}

1892
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@
"devDependencies": { "devDependencies": {
"ava": "^0.25.0", "ava": "^0.25.0",
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"babel-plugin-istanbul": "^4.1.6",
"babel-preset-env": "^1.7.0", "babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0", "babel-register": "^6.26.0",
"coveralls": "^3.0.2", "coveralls": "^3.0.2",

View File

@ -25,8 +25,8 @@ class Bowser {
* bowser.getBrowser() * bowser.getBrowser()
*/ */
constructor(UA, skipParsing=false) { constructor(UA, skipParsing=false) {
if (!UA) { if (typeof UA !== 'string') {
throw new Error('UserAgent is not defined'); throw new Error('UserAgent should be a string');
} }
return new Parser(UA, skipParsing); return new Parser(UA, skipParsing);
} }