generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pattini with the new pattini contract (#30)
* fix: new pattini contract * fix: get abi and contract address * fix: name contractFetch * fix: inform the user of the state of the call on chain * fix: error management * fix: lint * fix lint --------- Co-authored-by: theocdl <theo.claudel@edu.ece.fr>
- Loading branch information
Showing
3 changed files
with
51 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
import * as main from '../src/main' | ||
import * as core from '@actions/core' | ||
|
||
// Mock the action's entrypoint | ||
const runMock = jest.spyOn(main, 'run').mockImplementation() | ||
|
||
// Mock the GitHub Actions core library | ||
let getInputMock: jest.SpiedFunction<typeof core.getInput> | ||
|
||
describe('main', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks() | ||
|
||
getInputMock = jest.spyOn(core, 'getInput').mockImplementation() | ||
}) | ||
|
||
it('TO DO', async () => { | ||
// eslint-disable-next-line @typescript-eslint/no-require-imports | ||
require('../src/index') | ||
getInputMock.mockImplementation(name => { | ||
switch (name) { | ||
case 'ISSUE_NUMBER': | ||
return '1234-5678' | ||
case 'PULL_REQUEST_NUMBER': | ||
return '1234' | ||
case 'PRIVATE_KEY': | ||
return '0x1234567890abcdef' | ||
case 'ACTION': | ||
return 'test' | ||
case 'REPOSITORY': | ||
return 'my-org/my-repo' | ||
case 'GITHUB_TOKEN': | ||
return 'my-token' | ||
default: | ||
return '' | ||
} | ||
}) | ||
|
||
expect(runMock).toHaveBeenCalled() | ||
await main.run() | ||
expect(runMock).toHaveReturned() | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters