-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[♻] {PROD4POD-1931} Move zipfile mock-up and improve coverage #1205
The head ref may contain hidden characters: "\u267B-move-zipfile-mock-up"
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: For variables that don't get reassigned, we generally used const
(i.e. wherever possible).
✍️ Description
The mock for zip-files is more useful in the common
poly-import
module. 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
Storage
needs 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