Closed emimuresan closed 5 years ago
Not sure why the tests in TravisCI are failing with:
Expected substring: "expecting options object"
lockfile-lint-api: Received message: "Did not recive options for lockfile path or type"
I modified parseLockfile.test
, so instead of "expecting options object" it actually should be "Did not recive options for lockfile path or type", and that is what it asserts on in the test file.
@emimuresan I'm unable to reproduce the build failure locally either and I also tried resetting the build cache which didn't help. What about if you just open a new PR with the exact same code? I think you can just use a new branch to trigger a new PR
@emimuresan maybe you can rebase with master? checking out locally I see that I'm finding the test file being unstaged. This is probably why it's not getting through to the CI.
Merging #22 into master will increase coverage by
1.11%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #22 +/- ##
==========================================
+ Coverage 96.1% 97.22% +1.11%
==========================================
Files 9 11 +2
Lines 154 180 +26
Branches 21 25 +4
==========================================
+ Hits 148 175 +27
+ Misses 6 5 -1
Impacted Files | Coverage Δ | |
---|---|---|
...kages/lockfile-lint-api/src/common/PackageError.js | 100% <ø> (ø) |
:arrow_up: |
...s/lockfile-lint-api/src/validators/ValidateHost.js | 100% <100%> (ø) |
:arrow_up: |
...kages/lockfile-lint-api/src/common/ParsingError.js | 100% <100%> (ø) |
|
packages/lockfile-lint-api/src/ParseLockfile.js | 100% <100%> (+2.63%) |
:arrow_up: |
packages/lockfile-lint-api/src/common/constants.js | 100% <100%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ff32753...8e9d43c. Read the comment docs.
@emimuresan maybe you can rebase with master? checking out locally I see that I'm finding the test file being unstaged. This is probably why it's not getting through to the CI.
Yep, it was strange. Upon further investigation i discovered that there were 2 duplicate test files for ParseLockfile, i checked on master and it was the same:
parseLockFile.test.js
parseLockfile.test.js
I deleted parseLockFile.test.js
in this PR. Hopefully it should be ok in CI now.
Great work here @emimuresan ✨, thank you ❤️
Closes: #16
Description
Added enhanced and more informative error messages in
ParseLockfile.js
. The following error types are supported:NO_OPTIONS:
Programatically generated the scenario below, this isn't something that would happen normally:
NO_PARSER_FOR_TYPE:
NO_PARSER_FOR_PATH:
READ_FAILED:
PARSE_NPMLOCKFILE_FAILED:
PARSE_YARNLOCKFILE_FAILED
More Details
These error types are defined in
packages/lockfile-lint-api/src/common/ParsingError.js
and are used inpackages/lockfile-lint-api/src/ParseLockfile.js
.Types of changes
Related Issue
16
Motivation and Context
More descriptive/informative error messages when parsing a lockfile fails.
How Has This Been Tested?
Added/Updated unit tests for all scenarios.
Checklist: