From 2dcbd17a34a9475155a8c1e450acfea85ac320e1 Mon Sep 17 00:00:00 2001 From: Christopher Swenson Date: Tue, 28 Jun 2022 14:35:22 -0700 Subject: [PATCH] Add additional mocks needed for tests in new versions of @actions (#343) Tests started failing after @actions was bumped in https://github.com/hashicorp/vault-action/pull/334 --- src/auth.test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/auth.test.js b/src/auth.test.js index 769a4e3..ac689d3 100644 --- a/src/auth.test.js +++ b/src/auth.test.js @@ -1,7 +1,12 @@ jest.mock('got'); jest.mock('@actions/core'); jest.mock('@actions/core/lib/command'); -jest.mock("fs") +jest.mock('fs', () => ({ + stat: jest.fn().mockResolvedValue(null), + promises: { + access: jest.fn().mockResolvedValue(null), + } +})); const core = require('@actions/core'); const got = require('got');