From feff4b4d2a635434d1da69ad7726d8b2959c9e23 Mon Sep 17 00:00:00 2001 From: Simone Corsi Date: Mon, 9 May 2022 17:22:12 +0200 Subject: [PATCH] test: fixed old suites --- test/helpers.spec.ts | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/test/helpers.spec.ts b/test/helpers.spec.ts index 9c719ff9..89dc975a 100644 --- a/test/helpers.spec.ts +++ b/test/helpers.spec.ts @@ -5,16 +5,6 @@ import fs from 'fs'; import * as core from '@actions/core'; sinon.replace(core, 'getInput', sinon.fake()); -import GithubApi from '../src/api'; -const GithubApiFake = sinon.fake((rul) => ({ - body: [], - headers: { - link: - '; rel="next", ; rel="last"', - }, -})); -sinon.replace(GithubApi, 'get', GithubApiFake); - import Git from '../src/git'; const pull = sinon.fake(); sinon.replace(Git, 'pull', pull); @@ -31,30 +21,13 @@ const fsp = fs.promises; const writeFile = sinon.fake(); sinon.replace(fsp, 'writeFile', writeFile); -import { - wait, - renderer, - apiGetStar, - generateMd, - pushNewFiles, -} from '../src/helpers'; - -test('wait should wait', async (t) => { - await wait(200); - t.pass(); -}); +import { renderer, generateMd, pushNewFiles } from '../src/helpers'; test('renderer should render', async (t) => { const output = await renderer({ variable: 123 }, 'Test: <%= variable %>'); t.is(output, 'Test: 123'); }); -test('apiGetStar', async (t) => { - let stars = await apiGetStar('url'); - t.true(GithubApiFake.called); - t.true(Array.isArray(stars)); -}); - test('generateMd should create TOC', async (t) => { const tpl = `# title