-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
In the test in file src/api/rest/tests/MQRestClient.unit.test.ts
describe("ZosmfRestClient tests", () => {
it("should delete stack from any zosmf errors before presenting them to users", () => {
const zosmfRestClient = new MQRestClient(new Session({hostname: "dummy"}));
const shouldNotDeleteMessage = "This should not be deleted";
const shouldDeleteMessage = "This should be deleted";
const error: IImperativeError = {
msg: "hello",
causeErrors: JSON.stringify({
stack: shouldDeleteMessage,
shouldNotDelete: shouldNotDeleteMessage
})
};
const processedError = ((zosmfRestClient as any).processError(error));
expect(processedError.msg).toContain(shouldNotDeleteMessage);
expect(processedError.msg.indexOf()).toEqual(-1);
});
});
the line expect(processedError.msg.indexOf()).toEqual(-1); doesnt actually check the message has been deleted, it just happens that the default behaviour is to return -1
potential fix: expect(processedError.msg.indexOf(shouldDeleteMessage)).toEqual(-1);
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Low Priority