Skip to content

Commit

Permalink
[Tests] run nyc on all tests; use tape runner
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 13, 2021
1 parent 049c9bb commit fcb1ef1
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 33 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
dist/
coverage/
16 changes: 15 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,19 @@
"no-magic-numbers": 0,
"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
"operator-linebreak": [2, "before"],
}
},

"overrides": [
{
"files": "test/**",
"rules": {
"function-paren-newline": 0,
"max-lines-per-function": 0,
"max-statements": 0,
"no-buffer-constructor": 0,
"no-extend-native": 0,
"no-throw-literal": 0,
}
}
]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ dist/*
yarn.lock
package-lock.json
npm-shrinkwrap.json

# coverage output
coverage/
.nyc_output/
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"dist"
]
}
2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
}
}

leaf = obj; // eslint-disable-line no-param-reassign
leaf = obj;
}

return leaf;
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
"@ljharb/eslint-config": "^17.1.0",
"aud": "^1.1.2",
"browserify": "^16.5.1",
"covert": "^1.1.1",
"eclint": "^2.8.1",
"eslint": "^7.3.0",
"evalmd": "^0.0.19",
"for-each": "^0.3.3",
"has-symbols": "^1.0.1",
"iconv-lite": "^0.5.1",
"mkdirp": "^0.5.5",
"nyc": "^10.3.2",
"object-inspect": "^1.8.0",
"qs-iconv": "^1.0.4",
"safe-publish-latest": "^1.1.4",
Expand All @@ -51,13 +51,12 @@
"scripts": {
"prepublish": "safe-publish-latest && npm run dist",
"pretest": "npm run --silent readme && npm run --silent lint",
"test": "npm run --silent coverage",
"tests-only": "node test",
"posttest": "npx aud --production",
"test": "npm run tests-only",
"tests-only": "nyc tape 'test/**/*.js'",
"posttest": "aud --production",
"readme": "evalmd README.md",
"postlint": "eclint check * lib/* test/*",
"lint": "eslint lib/*.js test/*.js",
"coverage": "covert test",
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
},
"license": "BSD-3-Clause",
Expand Down
18 changes: 0 additions & 18 deletions test/.eslintrc

This file was deleted.

7 changes: 0 additions & 7 deletions test/index.js

This file was deleted.

0 comments on commit fcb1ef1

Please sign in to comment.