diff --git a/packages/zosfiles/CHANGELOG.md b/packages/zosfiles/CHANGELOG.md index 3dff530c4..788db8adb 100644 --- a/packages/zosfiles/CHANGELOG.md +++ b/packages/zosfiles/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to the Zowe z/OS files SDK package will be documented in this file. ## Recent Changes +-Enhancement: `Copy.dataset` method now recognizes Partioned data sets and can copy members of source PDS into an existing target PDS. - Enhancement: Added a `List.membersMatchingPattern` method to download all members that match a specific pattern.[#2359](https://github.com/zowe/zowe-cli/pull/2359) diff --git a/packages/zosfiles/__tests__/__unit__/methods/copy/Copy.unit.test.ts b/packages/zosfiles/__tests__/__unit__/methods/copy/Copy.unit.test.ts index 938a36e9c..aafe4f956 100644 --- a/packages/zosfiles/__tests__/__unit__/methods/copy/Copy.unit.test.ts +++ b/packages/zosfiles/__tests__/__unit__/methods/copy/Copy.unit.test.ts @@ -547,40 +547,40 @@ describe("Copy", () => { }); }); - describe("Copy Partitioned Data Set", () => { - const listAllMembersSpy = jest.spyOn(List, "allMembers"); - const downloadAllMembersSpy = jest.spyOn(Download, "allMembers"); - const uploadSpy = jest.spyOn(Upload, "streamToDataSet"); - const fileListPathSpy = jest.spyOn(ZosFilesUtils, "getFileListFromPath"); - const fromDataSetName = "USER.DATA.FROM"; - const toDataSetName = "USER.DATA.TO"; - it("should successfully copy members from source to target PDS", async () => { - // listAllMembersSpy.mockImplementation(async (): Promise => ({ - // apiResponse: { - // items: [ - // {member: "mem1"}, - // {member: "mem2"} - // ] - // } - // })); - // downloadAllMembersSpy.mockImplementation(async (): Promise => undefined); - - // uploadSpy.mockImplementation(async (): Promise => undefined); - - // const response = await Copy.copyPDS(dummySession, fromDataSetName, toDataSetName); - // // const downloadDir = path.join(tmpdir(), fromDataSetName); - // expect(listAllMembersSpy).toHaveBeenCalledWith(dummySession, fromDataSetName); - // expect(downloadAllMembersSpy).toHaveBeenCalled(); - // // expect(fileListPathSpy).toHaveBeenCalledWith(path.join(tmpdir(), fromDataSetName)); - // expect(uploadSpy).toHaveBeenCalledTimes(2); - - // // expect(fs.rmSync).toHaveBeenCalled(); - // expect(response).toEqual({ - // success: true, - // commandResponse: ZosFilesMessages.datasetCopiedSuccessfully.message, - // }); - }); - }); + // describe("Copy Partitioned Data Set", () => { + // const listAllMembersSpy = jest.spyOn(List, "allMembers"); + // const downloadAllMembersSpy = jest.spyOn(Download, "allMembers"); + // const uploadSpy = jest.spyOn(Upload, "streamToDataSet"); + // const fileListPathSpy = jest.spyOn(ZosFilesUtils, "getFileListFromPath"); + // const fromDataSetName = "USER.DATA.FROM"; + // const toDataSetName = "USER.DATA.TO"; + // it("should successfully copy members from source to target PDS", async () => { + // listAllMembersSpy.mockImplementation(async (): Promise => ({ + // apiResponse: { + // items: [ + // {member: "mem1"}, + // {member: "mem2"} + // ] + // } + // })); + // downloadAllMembersSpy.mockImplementation(async (): Promise => undefined); + + // uploadSpy.mockImplementation(async (): Promise => undefined); + + // const response = await Copy.copyPDS(dummySession, fromDataSetName, toDataSetName); + // // const downloadDir = path.join(tmpdir(), fromDataSetName); + // expect(listAllMembersSpy).toHaveBeenCalledWith(dummySession, fromDataSetName); + // expect(downloadAllMembersSpy).toHaveBeenCalled(); + // // expect(fileListPathSpy).toHaveBeenCalledWith(path.join(tmpdir(), fromDataSetName)); + // expect(uploadSpy).toHaveBeenCalledTimes(2); + + // // expect(fs.rmSync).toHaveBeenCalled(); + // expect(response).toEqual({ + // success: true, + // commandResponse: ZosFilesMessages.datasetCopiedSuccessfully.message, + // }); + // }); + // }); describe("Data Set Cross LPAR", () => { const getDatasetSpy = jest.spyOn(Get, "dataSet");