Level / abstract-leveldown

An abstract prototype matching the leveldown API.
MIT License
146 stars 53 forks source link

Add code coverage #250

Closed vweevers closed 6 years ago

vweevers commented 6 years ago

Ref https://github.com/Level/community/issues/34.

vweevers commented 6 years ago

We need to increase the max body size in airtap:

PayloadTooLargeError: request entity too large
    at readStream (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\raw-body\index.js:155:17)
    at getRawBody (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\raw-body\index.js:108:12)
    at read (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\body-parser\lib\read.js:77:3)
    at jsonParser (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\body-parser\lib\types\json.js:135:5)
    at Layer.handle [as handle_request] (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\express\lib\router\index.js:317:13)
    at D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\express\lib\router\index.js:335:12)
    at next (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\express\lib\router\index.js:275:10)
    at compression (D:\Projecten\GitHub\Level\abstract-leveldown\node_modules\compression\index.js:220:5)
vweevers commented 6 years ago

Should we exclude abstract/* from coverage? Only implementations can achieve 100% coverage.

image

Also, when we add code coverage to implementations, we should check that abstract is not excluded (due to it being in node_modules). edit: coverage of test code doesn't matter.

vweevers commented 6 years ago

Blocked by release of https://github.com/airtap/airtap/issues/201.

ralphtheninja commented 6 years ago

Should we exclude abstract/* from coverage? Only implementations can achieve 100% coverage.

Makes sense.

vweevers commented 6 years ago

Excluding works differently in nyc (node tests) and browserify-instanbul (browser tests). In addition, because browserify-instanbul is a transform controlled by airtap, airtap has to set the ignore option. Hm.

vweevers commented 6 years ago

Well, heh, one option is to rename abstract/ to test/, so that it matches the default ignore options 😄