Skip to content

Commit fcb1ef1

Browse files
committed
[Tests] run nyc on all tests; use tape runner
1 parent 049c9bb commit fcb1ef1

File tree

8 files changed

+39
-33
lines changed

8 files changed

+39
-33
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
dist
1+
dist/
2+
coverage/

.eslintrc

+15-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,19 @@
1717
"no-magic-numbers": 0,
1818
"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
1919
"operator-linebreak": [2, "before"],
20-
}
20+
},
21+
22+
"overrides": [
23+
{
24+
"files": "test/**",
25+
"rules": {
26+
"function-paren-newline": 0,
27+
"max-lines-per-function": 0,
28+
"max-statements": 0,
29+
"no-buffer-constructor": 0,
30+
"no-extend-native": 0,
31+
"no-throw-literal": 0,
32+
}
33+
}
34+
]
2135
}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ dist/*
1010
yarn.lock
1111
package-lock.json
1212
npm-shrinkwrap.json
13+
14+
# coverage output
15+
coverage/
16+
.nyc_output/

.nycrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"all": true,
3+
"check-coverage": false,
4+
"reporter": ["text-summary", "text", "html", "json"],
5+
"lines": 86,
6+
"statements": 85.93,
7+
"functions": 82.43,
8+
"branches": 76.06,
9+
"exclude": [
10+
"coverage",
11+
"dist"
12+
]
13+
}

lib/parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
140140
}
141141
}
142142

143-
leaf = obj; // eslint-disable-line no-param-reassign
143+
leaf = obj;
144144
}
145145

146146
return leaf;

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
"@ljharb/eslint-config": "^17.1.0",
3535
"aud": "^1.1.2",
3636
"browserify": "^16.5.1",
37-
"covert": "^1.1.1",
3837
"eclint": "^2.8.1",
3938
"eslint": "^7.3.0",
4039
"evalmd": "^0.0.19",
4140
"for-each": "^0.3.3",
4241
"has-symbols": "^1.0.1",
4342
"iconv-lite": "^0.5.1",
4443
"mkdirp": "^0.5.5",
44+
"nyc": "^10.3.2",
4545
"object-inspect": "^1.8.0",
4646
"qs-iconv": "^1.0.4",
4747
"safe-publish-latest": "^1.1.4",
@@ -51,13 +51,12 @@
5151
"scripts": {
5252
"prepublish": "safe-publish-latest && npm run dist",
5353
"pretest": "npm run --silent readme && npm run --silent lint",
54-
"test": "npm run --silent coverage",
55-
"tests-only": "node test",
56-
"posttest": "npx aud --production",
54+
"test": "npm run tests-only",
55+
"tests-only": "nyc tape 'test/**/*.js'",
56+
"posttest": "aud --production",
5757
"readme": "evalmd README.md",
5858
"postlint": "eclint check * lib/* test/*",
5959
"lint": "eslint lib/*.js test/*.js",
60-
"coverage": "covert test",
6160
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
6261
},
6362
"license": "BSD-3-Clause",

test/.eslintrc

-18
This file was deleted.

test/index.js

-7
This file was deleted.

0 commit comments

Comments
 (0)