Update warnings behavior

This commit is contained in:
Josh Gross 2019-11-20 13:19:40 -05:00
parent d9fe1b81f9
commit c48b49d8ee
8 changed files with 82 additions and 40 deletions

View file

@ -162,6 +162,16 @@ test("getCacheState with valid state", () => {
expect(getStateMock).toHaveBeenCalledTimes(1);
});
test("logWarning logs a message with a warning prefix", () => {
const message = "A warning occurred.";
const infoMock = jest.spyOn(core, "info");
actionUtils.logWarning(message);
expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
});
test("isValidEvent returns false for unknown event", () => {
const event = "foo";
process.env[Events.Key] = event;