Skip to content

Commit

Permalink
updated changelog
Browse files Browse the repository at this point in the history
Signed-off-by: Pujal <[email protected]>
  • Loading branch information
pujal0909 committed Dec 20, 2024
1 parent dcdb848 commit 8e502df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/zosfiles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to the Zowe z/OS files SDK package will be documented in this file.

## Recent Changes
- Enhancement: The `Copy.dataset` method now creates a new data set if the inputted target data set does not exist.

## Recent Changes
- Enhancement: The `Copy.dataset` method now recognizes partioned data sets and can copy members of a source PDS into an existing target PDS. [#2386](https://github.com/zowe/zowe-cli/pull/2386)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ describe("Copy", () => {
const toDataSetName = "USER.DATA.TO";
const toMemberName = "mem2";
let isPDSSpy: jest.SpyInstance;
let dataSetExistsSpy: jest.SpyInstance;

beforeEach(() => {
copyExpectStringSpy.mockClear();
copyExpectStringSpy.mockImplementation(async () => {
return "";
});
isPDSSpy = jest.spyOn(Copy as any, "isPDS").mockResolvedValue(false);
dataSetExistsSpy = jest.spyOn(Copy, "dataSetExists").mockResolvedValue(true);
});
afterAll(() => {
isPDSSpy.mockRestore();
dataSetExistsSpy.mockRestore();
});
describe("Success Scenarios", () => {
describe("Sequential > Sequential", () => {
Expand Down Expand Up @@ -453,12 +456,17 @@ describe("Copy", () => {
commandResponse: ZosFilesMessages.datasetCopiedSuccessfully.message,
});
isPDSSpy = jest.spyOn(Copy as any, "isPDS").mockResolvedValue(true);
createSpy = jest.spyOn(Create, "dataSetLike");
createSpy = jest.spyOn(Create, "dataSetLike").mockResolvedValue({
success: true,
commandResponse: ZosFilesMessages.dataSetCreatedSuccessfully.message
});
dataSetExistsSpy = jest.spyOn(Copy, "dataSetExists");
});
afterAll(() => {
copyPDSSpy.mockRestore();
isPDSSpy.mockRestore();
});
afterEach(() => {
createSpy.mockRestore();
dataSetExistsSpy.mockRestore();
});
Expand All @@ -482,29 +490,29 @@ describe("Copy", () => {
});
});
it("should call Create.dataSetLike and create a new data set if the target data set inputted does not exist", async() => {
dataSetExistsSpy.mockResolvedValue(false);
const response = await Copy.dataSet(
dummySession,
{dsn: toDataSetName},
{"from-dataset": {
dsn:fromDataSetName
}}
);
dataSetExistsSpy.mockResolvedValue(false);
expect(createSpy).toHaveBeenCalledWith(dummySession, toDataSetName, fromDataSetName);
expect(createSpy).toHaveBeenCalled();
expect(response).toEqual({
success: true,
commandResponse: ZosFilesMessages.datasetCopiedSuccessfully.message
});
});
it("should not create a new data set if the target data set inputted exists", async() => {
dataSetExistsSpy.mockResolvedValue(true);
const response = await Copy.dataSet(
dummySession,
{dsn: toDataSetName},
{"from-dataset": {
dsn:fromDataSetName
}}
);
dataSetExistsSpy.mockResolvedValue(true);
expect(createSpy).not.toHaveBeenCalled();
expect(response).toEqual({
success: true,
Expand Down

0 comments on commit 8e502df

Please sign in to comment.