-
Notifications
You must be signed in to change notification settings - Fork 85
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
Always treat encoding as a string for encoding.trim() #2392
Conversation
encoding.trim() only works if encoding is interpreted as a string, but it might just be a number. Signed-off-by: COBOL-Erik <[email protected]>
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.
Hey @COBOL-Erik,
The fix LGTM! 😋
Curious if you could:
- Add a Changelog entry to the
packages/zosjobs/src/CHANGELOG.md
file? - (maybe) add a quick test for the encoding being a number? 🙏
More succinct Co-authored-by: Fernando Rijo Cedeno <[email protected]> Signed-off-by: COBOL-Erik <[email protected]>
Hi! |
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.
Left a few comments to address.
Note: even though typescript should prevent people from calling the getSpoolContentById
with a number e.g. 939
as the encoding value, nothing prevents people from bypassing it 😋
And for the test, you could add a new one in:
packages/zosjobs/__tests__/__unit__/GetJobs.unit.test.ts
And you could copy the following test to create a new one:
it("should return spool content from getSpoolContentById with encoding if z/OSMF response is mocked" ...
And the resulting test might look something like this:
it("should return spool content from getSpoolContentById with encoding as a number if z/OSMF response is mocked", async () => {
(ZosmfRestClient.getExpectString as any) = mockGetJobsStringData(GetJobsData.SAMPLE_JES_MSG_LG);
const content = await GetJobs.getSpoolContentById(pretendSession, "MYJOB1", "JOB0123", 1, 939 as any);
expect((ZosmfRestClient.getExpectString as any).mock.calls[0][1]).toContain("fileEncoding=939");
expect(content).toEqual(GetJobsData.SAMPLE_JES_MSG_LG);
});
I have tried to do everything by the book now. I'm sure I have missed something... Where are we? |
Co-authored-by: Timothy Johnson <[email protected]> Signed-off-by: COBOL-Erik <[email protected]>
"Recent Changes" Co-authored-by: Fernando Rijo Cedeno <[email protected]> Signed-off-by: COBOL-Erik <[email protected]>
Co-authored-by: Fernando Rijo Cedeno <[email protected]> Signed-off-by: COBOL-Erik <[email protected]>
Co-authored-by: Timothy Johnson <[email protected]> Signed-off-by: COBOL-Erik <[email protected]>
There were 2 commits that were not properly signed off:
I've rebased the PR to amend these commits so the DCO check should be passing now. As the Audit check is failing on master branch, you don't need to worry about it. 🙂 In the future, please ensure when making Git commits that your Git author is set to |
Quality Gate passedIssues Measures |
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.
LGTM, thanks @COBOL-Erik!
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.
Thanks for the fix @COBOL-Erik!
Release succeeded for the The following packages have been published:
Powered by Octorelease 🚀 |
encoding.trim() only works if encoding is interpreted as a string, but it might just be a number.
What It Does
How to Test
Review Checklist
I certify that I have:
Additional Comments