{"id":14986060,"url":"https://github.com/technote-space/github-action-test-helper","last_synced_at":"2025-04-11T22:21:33.062Z","repository":{"id":38434775,"uuid":"210094811","full_name":"technote-space/github-action-test-helper","owner":"technote-space","description":"Test helper for GitHub Actions.","archived":false,"fork":false,"pushed_at":"2023-12-28T09:04:10.000Z","size":2932,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T14:54:54.067Z","etag":null,"topics":["github-actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technote-space.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://paypal.me/technote0space"}},"created_at":"2019-09-22T05:20:35.000Z","updated_at":"2023-03-20T13:41:12.000Z","dependencies_parsed_at":"2023-10-16T19:10:20.031Z","dependency_job_id":"23059f94-187f-481e-957e-72d320a96249","html_url":"https://github.com/technote-space/github-action-test-helper","commit_stats":null,"previous_names":[],"tags_count":149,"template":false,"template_full_name":"technote-space/ts-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fgithub-action-test-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fgithub-action-test-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fgithub-action-test-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fgithub-action-test-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technote-space","download_url":"https://codeload.github.com/technote-space/github-action-test-helper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487666,"owners_count":21112191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions"],"created_at":"2024-09-24T14:12:13.024Z","updated_at":"2025-04-11T22:21:33.029Z","avatar_url":"https://github.com/technote-space.png","language":"TypeScript","funding_links":["https://paypal.me/technote0space"],"categories":[],"sub_categories":[],"readme":"# GitHub Actions Test Helper\n\n[![npm version](https://badge.fury.io/js/%40technote-space%2Fgithub-action-test-helper.svg)](https://badge.fury.io/js/%40technote-space%2Fgithub-action-test-helper)\n[![CI Status](https://github.com/technote-space/github-action-test-helper/workflows/CI/badge.svg)](https://github.com/technote-space/github-action-test-helper/actions)\n[![codecov](https://codecov.io/gh/technote-space/github-action-test-helper/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/github-action-test-helper)\n[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/github-action-test-helper/badge)](https://www.codefactor.io/repository/github/technote-space/github-action-test-helper)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/github-action-test-helper/blob/master/LICENSE)\n\nGitHub Actions 用テストヘルパー\n\n*Read this in other languages: [English](README.md), [日本語](README.ja.md).*\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\u003cdetails\u003e\n\u003csummary\u003eDetails\u003c/summary\u003e\n\n- [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)\n- [Author](#author)\n\n\u003c/details\u003e\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## 使用方法\n1. インストール  \n`npm i @technote-space/github-action-test-helper`\n2. Vitest の設定\n```js\n/// \u003creference types=\"vitest\" /\u003e\nimport { defineConfig } from 'vite';\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n  test: {\n    setupFiles: './src/setup.ts',\n    clearMocks: true,\n    mockReset: true,\n    restoreMocks: true,\n    coverage: {\n      reporter: ['html', 'lcov'],\n    },\n    deps: {\n      // 以下の設定が必要\n      inline: [/github-action-test-helper/]\n    },\n  },\n});\n```\n3. 使用\n```js\nimport {\n\tgetContext,\n\tgenerateContext,\n\tencodeContent,\n\tgetConfigFixture,\n\tgetApiFixture,\n\tdisableNetConnect,\n\ttestEnv,\n\ttestChildProcess,\n\tsetChildProcessParams,\n\ttestFs,\n\tspyOnStdout,\n\tstdoutCalledWith,\n\tstdoutContains,\n\tstdoutNotContains,\n\tspyOnExec,\n\texecCalledWith,\n\texecContains,\n\texecNotContains,\n\ttestProperties,\n\tsetupGlobal,\n\tgetOctokit,\n} from '@technote-space/github-action-test-helper';\nimport nock from 'nock';\n\ngetContext({});\ngenerateContext({});\nencodeContent('content');\ngetConfigFixture('rootDir', 'fileName');\ngetApiFixture('rootDir', 'name');\ndisableNetConnect(nock);\ntestEnv();\ntestChildProcess();\nsetChildProcessParams({stdout: 'test-stdout', stderr: 'test-stderr', error: new Error('test-error')});\ntestFs();\nconst stdoutSpy = spyOnStdout();\nstdoutCalledWith(stdoutSpy, []);\nstdoutContains(stdoutSpy, []);\nstdoutNotContains(stdoutSpy, []);\nconst execSpy = spyOnExec();\nexecCalledWith(execSpy, []);\nexecContains(execSpy, []);\nexecNotContains(execSpy, []);\ntestProperties({}, {});\nsetupGlobal();\ngetOctokit();\n```\n\n## Author\n[GitHub (Technote)](https://github.com/technote-space)  \n[Blog](https://technote.space)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Fgithub-action-test-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnote-space%2Fgithub-action-test-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Fgithub-action-test-helper/lists"}