[♻] {PROD4POD-1931} Move zipfile mock-up and improve coverage#1205
Merged
Conversation
fhd
approved these changes
Oct 13, 2022
Contributor
fhd
left a comment
There was a problem hiding this comment.
Generally LGTM - but it probably makes sense for Richard to take a look since he wrote at least some of it.
|
|
||
| it("passes through non-string data", () => { | ||
| const foo42 = { foo: 42 }; | ||
| expect(jsonStringifyWithUtfEscape(foo42)).toBe('{"foo":42}'); |
Contributor
There was a problem hiding this comment.
Nit: I'd do: expect(jsonStringifyWithoutUtfEscape(foo42)).toBe(JSON.stringify(foo42)) - to be more clear that it's just a normal stringify without UTF-8 data. But no strong opinion, being explicit with the values is also good.
| let status = null; | ||
|
|
||
| beforeAll(async () => { | ||
| let zipFile = new ZipFileMock(); |
Contributor
There was a problem hiding this comment.
Nit: For variables that don't get reassigned, we generally used const (i.e. wherever possible).
added 6 commits
October 14, 2022 11:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✍️ Description
The mock for zip-files is more useful in the common
poly-importmodule. That way it can also be used in the module itself to mock zipfiles, and imported from any module that needs to mock zips.While we were at it, boost a bit coverage of said test.
🏗️ Fixes PROD4POD-1931
It is a precondition for #1204, since
Storageneeds zip files to be tested.ℹ️ Other information
Some minor refactoring also made.
Might include some refactoring of tests, mainly to reduce boilerplate. Not for the time being.
Additional functionality