Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions __tests__/api/BundleContent/AutoBundler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AutoBundler } from "../../../src/api/BundleContent/AutoBundler";
import { IHandlerParameters } from "@zowe/imperative";
import * as GenerateBundleDefinition from "../../../src/cli/generate/bundle/GenerateBundle.definition";
import * as fse from "fs-extra";
import { Readable } from "stream";


const DEFAULT_PARAMETERS: IHandlerParameters = {
Expand All @@ -21,11 +22,6 @@ const DEFAULT_PARAMETERS: IHandlerParameters = {
_: ["zowe-cli-cics-deploy-plugin", "generate", "bundle"],
silent: true
},
profiles: {
get: (type: string) => {
return {};
}
} as any,
response: {
data: {
setMessage: jest.fn((setMsgArgs) => {
Expand All @@ -42,16 +38,17 @@ const DEFAULT_PARAMETERS: IHandlerParameters = {
error: jest.fn((errors) => {
expect("" + errors).toMatch("NO ERRORS ARE EXPECTED");
}),
errorHeader: jest.fn(() => undefined)
errorHeader: jest.fn(() => { fail("No errors are expected") })
},
progress: {
startBar: jest.fn((parms) => undefined),
endBar: jest.fn(() => undefined)
startBar: jest.fn((parms) => fail("Unexpected") ),
endBar: jest.fn(() => fail("Unexpected") )
}
} as any,
definition: GenerateBundleDefinition.GenerateBundleDefinition,
fullDefinition: GenerateBundleDefinition.GenerateBundleDefinition,
positionals: [],
stdin: new Readable()
};

describe("AutoBundler01", () => {
Expand Down Expand Up @@ -124,6 +121,7 @@ describe("AutoBundler01", () => {
let err: Error;
try {
const ab = new AutoBundler("__tests__/__resources__/ExampleBundle01", parms);
fail("Should have thrown error condition");
} catch (e) {
err = e;
}
Expand Down Expand Up @@ -195,6 +193,7 @@ async function runAutoBundleWithError(parms: IHandlerParameters, dir: string) {
let err: Error;
try {
const ab = new AutoBundler(dir, parms);
fail("Should have thrown error condition");
} catch (e) {
err = e;
}
Expand Down
Loading
Loading