How to mock @actions/github?

141 views Asked by At

I have a GitHub action that is running on node. My node js file looks like this:

import fs from 'fs';
import * as core from '@actions/core';
import * as github from '@actions/github';
import { Octokit } from '@octokit/rest';

async function runAction() {

  const comments = await octokit.paginate(octokit.rest.issues.listComments, {
    1,
    "my_repo",
    1,
    per_page: 100,
  });
console.log(comments)
}

I'm trying to test this code - however I cannot seem to find a way of mocking @actions/github's listComments function.

Does anyone have any advice?

0

There are 0 answers