mirror of
https://github.com/actions/setup-node.git
synced 2026-02-14 01:14:48 +08:00
Merge 7d1c5630d8 into 48b90677b6
This commit is contained in:
@@ -38,6 +38,8 @@ describe('main tests', () => {
|
||||
|
||||
let setupNodeJsSpy: jest.SpyInstance;
|
||||
|
||||
let processExitSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
inputs = {};
|
||||
|
||||
@@ -76,6 +78,10 @@ describe('main tests', () => {
|
||||
|
||||
setupNodeJsSpy = jest.spyOn(OfficialBuilds.prototype, 'setupNodeJs');
|
||||
setupNodeJsSpy.mockImplementation(() => {});
|
||||
|
||||
processExitSpy = jest
|
||||
.spyOn(process, 'exit')
|
||||
.mockImplementation((() => {}) as () => never);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -237,6 +243,12 @@ describe('main tests', () => {
|
||||
`::error::The specified node version file at: ${versionFilePath} does not exist${osm.EOL}`
|
||||
);
|
||||
});
|
||||
|
||||
it('should call process.exit() explicitly after running', async () => {
|
||||
await main.run();
|
||||
|
||||
expect(processExitSpy).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('cache on GHES', () => {
|
||||
|
||||
Reference in New Issue
Block a user