existing-source-check.integ.ts 945 B

123456789101112131415161718192021222324252627
  1. import { Octokit } from '@octokit/action';
  2. import { describe, expect, test } from 'vitest';
  3. import { baseIssueMetadata, waitForClosedIssue } from './util';
  4. import { deleteIssue } from '../src/util/issues';
  5. const octokit = new Octokit();
  6. describe('Existing source check', () => {
  7. // TODO: there isn't much to test against now...
  8. test.skip('Issue created for an existing source gets automatically closed', async () => {
  9. const createdIssue = await octokit.issues.create({
  10. ...baseIssueMetadata,
  11. title: '[Test] This should be closed since the source already exists',
  12. body: 'Please add http://127.0.0.1:3000!',
  13. labels: ['enhancement', 'test'],
  14. });
  15. const issue = await waitForClosedIssue(octokit, createdIssue.data.number);
  16. expect(issue.data.state).toStrictEqual('closed');
  17. expect(issue.data.state_reason).toStrictEqual('not_planned');
  18. await deleteIssue(octokit, issue.data.node_id);
  19. });
  20. });