{"repo":"kiegroup/mock-github","free":true,"listed":false,"github":"https://github.com/kiegroup/mock-github","clone":"git clone https://github.com/kiegroup/mock-github.git","description":"A library to create a local github environment and easily mock github APIs using an octokit like interface","language":"TypeScript","stars":65,"topics":["custom-github-actions-workflows","github","mock","testing","github-actions"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"Mock Github Provides a bunch of tools to configure and create a local github environment to test your custom github actions in without having to clutter your github with test repositories, actions or hitting github api rate limits. Using this library along with kiegroup/act-js can provide you with all the tools you need to test your workflow files as well as your customs locally. Table of Content - Moctokit - Initialization options - Mock an api - Mock the entire endpoint - Mock an endpoint for specific parameter(s) and header(s) - Replying with a response - Reply once - Reply N times - Chaining responses - Typescript Support - MockGithub - Requirements - Repositories - Utility functions - Env - Utility functions - Action - Input - Utility functions - Archive artifacts - Utility functions - Example with act-js Moctokit [!WARNING] Moctokit is currently not compatible with Node 18's native fetch implementation since it uses nock under the hood See nock/nock#2397 Allows you to mock octokit using an octokit like interface. Example Initialization options By default a moctokit instance uses https://api.github.com as the base url You can also specify a base url when a creating a new instance. Useful when you have an enterprise github api url. You can enable other APIs to pass through if there is no exact match Mock an api You can mock all the github api exactly how @octokit/rest library is used to make an actual call to the corresponding api. Mock the entire endpoint You can mock an","default_branch":null,"files":null,"tree":[],"storefront":"/r/kiegroup","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kiegroup/mock-github/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}