@@ -24,21 +24,15 @@ const tmpDir = fs.mkdtempSync(
2424// Other utilities
2525
2626// Mock the GitHub Actions core library
27- //let debugMock: jest.SpiedFunction<typeof core.debug>
2827let errorMock : jest . SpiedFunction < typeof core . error >
2928let getInputMock : jest . SpiedFunction < typeof core . getInput >
30- //let setFailedMock: jest.SpiedFunction<typeof core.setFailed>
31- //let setOutputMock: jest.SpiedFunction<typeof core.setOutput>
3229
3330describe ( 'action' , ( ) => {
3431 beforeEach ( ( ) => {
3532 jest . clearAllMocks ( )
3633
37- //debugMock = jest.spyOn(core, 'debug').mockImplementation()
3834 errorMock = jest . spyOn ( core , 'error' ) . mockImplementation ( )
3935 getInputMock = jest . spyOn ( core , 'getInput' ) . mockImplementation ( )
40- //setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation()
41- //setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation()
4236 } )
4337
4438 it ( 'downloads 14.0.0' , async ( ) => {
@@ -56,45 +50,6 @@ describe('action', () => {
5650
5751 await main . run ( )
5852 expect ( runMock ) . toHaveReturned ( )
59-
60- // Verify that all of the core library functions were called correctly
61- /* expect(debugMock).toHaveBeenNthCalledWith(1, 'Waiting 500 milliseconds ...')
62- expect(debugMock).toHaveBeenNthCalledWith(
63- 2,
64- expect.stringMatching(timeRegex)
65- )
66- expect(debugMock).toHaveBeenNthCalledWith(
67- 3,
68- expect.stringMatching(timeRegex)
69- )
70- expect(setOutputMock).toHaveBeenNthCalledWith(
71- 1,
72- 'time',
73- expect.stringMatching(timeRegex)
74- )
75- */
7653 expect ( errorMock ) . not . toHaveBeenCalled ( )
7754 } )
78-
79- /*it('sets a failed status', async () => {
80- // Set the action's inputs as return values from core.getInput()
81- getInputMock.mockImplementation(name => {
82- switch (name) {
83- case 'milliseconds':
84- return 'this is not a number'
85- default:
86- return ''
87- }
88- })
89-
90- await main.run()
91- expect(runMock).toHaveReturned()
92-
93- // Verify that all of the core library functions were called correctly
94- expect(setFailedMock).toHaveBeenNthCalledWith(
95- 1,
96- 'milliseconds not a number'
97- )
98- expect(errorMock).not.toHaveBeenCalled()
99- })*/
10055} )
0 commit comments