Repository navigation
Add manifest fixtures & manifest json encoding round-trip test - #229
Conversation
|
The JSON encoding of However, a proper Manifest (I.e. with the ranges converted) should roundtrip properly. Have you found that this is not the case? Also, I'm not sure I understand what's the goal of the tests being added in this PR? |
I think the real issue is that the range1 = { original: "^1.0.0", converted: ">=1.0.0 <=2.0.0-0" }
range2 = { original: ">=1.0.0 <=2.0.0-0", converted: ">=1.0.0 <2.0.0-0" }This means that if you take a
Correct: if the
The goal of these tests were to isolate issues we ran into adding tests for the registry index. We'd write a bunch of manifests out to the registry index, and then read them back, and check the on-disk registry index against the in-memory registry index and find that they were failing an |
I have memory of us pairing on this, so I was hoping you'd remember 😄
Yea, if we have to use a different
I see now, thanks! |
We might have just been parsing into the |
This morning @thomashoneyman and I were working on adding more comprehensive tests for the
Registry.Indexmodule, when we noticed that theManifesttype's JSON encoding/decoding doesn't roundtrip into an equivalent value.We expected it would, so I put this test together to get to the root cause.
I've isolated the cause to our handling of the
Rangetype - specifically, when we encode it, we use theconvertedentry, which may not be the same as theoriginalentry.Swapping
printRangeto print theoriginalentry makes these tests pass, but makes the existingParse Range "^1.3.4" into ">=1.3.4 <2.0.0-0"fail.For now I haven't applied any changes to the implementation of
printRange, as I wanted to double check with @f-f and @thomashoneyman about what the expected behavior is.