SP-1091: replace json writes and zip file reads with real files in temp directory#376
Open
Jing Sun (kuvia) wants to merge 7 commits into
Open
Conversation
| } | ||
|
|
||
| public async readFileToJson<T>(fileName: string): Promise<T> { | ||
| public readFileToJson<T>(fileName: string): Promise<T> { |
Contributor
There was a problem hiding this comment.
Can you also change the type and also not await it in the usages
|
Mert Tunçay (merttuncay)
requested changes
Jun 17, 2026
|
|
||
| const variableExportRequest = parse(mockedPostRequestBodyByUrl.get("https://myTeam.celonis.cloud/package-manager/api/core/packages/export/batch/variables-with-assignments")); | ||
| expect(variableExportRequest).toEqual(packageKeyAndVersionPairs); | ||
| const downloadedFile = getJsonFromDownloadedFile(); |
There was a problem hiding this comment.
Could we remove this variable assignment since it is not used and the function is directly called in the expect statement? Thanks!
| @@ -0,0 +1,38 @@ | |||
| import { readFileSync, mkdirSync } from "fs"; | |||
There was a problem hiding this comment.
I think these imports should be from "node:fs", right? Thanks!
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
Removed general mocking of
fs, this had a lot of cascading changes, most of which are writes to JSON files that have all been replaced by real file writes. I have also replaced all mocks of zip file reading occasions in package import.Instances where file mocks were kept are git branch and profile reads because they strictly don't read from a temp dir but from a git repo and homedir respectively. If we want to change those too I would propose to do it in a different task because the PR is big enough as is.
Relevant links
Checklist