zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
159 stars 89 forks source link

Consolidate module mocks between packages #2817

Open traeok opened 3 months ago

traeok commented 3 months ago

Is your feature request related to a problem? Please describe.

Should we add a top level __mocks__ folder like Zowe CLI has? zowe-cli/__mocks__

This might reduce some duplication between zowe-explorer and zowe-explorer-api package if they share the same VSCode mocks.

Original suggestion from @t1m0thyj in #2777

Describe the solution you'd like

Consolidate module mocks from Zowe Explorer API, the FTP extension, and Zowe Explorer itself into a top-level __mocks__ folder where necessary.

The most notable module mock that can be consolidated is vscode.ts.

Describe alternatives you've considered

Duplicating module mock types and functions in each file, but the current module mocks go against the "DRY" principle and can be easily avoided by merging the mock files where possible.

zFernand0 commented 2 months ago

Would it make sense to create a @zowe/vsce-test-utils (private?) package? 😋