@@ -2,7 +2,6 @@ import { promises as fs } from "fs";
22import { getOctokit } from "@actions/github" ;
33import git from "isomorphic-git" ;
44import { afterAll , beforeAll , describe , expect , it , vi } from "vitest" ;
5- import type { CommitMessage } from "../../src/github/graphql/generated/types.ts" ;
65import {
76 createRefMutation ,
87 getRefTreeQuery ,
@@ -497,97 +496,6 @@ describe("node", () => {
497496 } ) ;
498497 } ) ;
499498 } ) ;
500-
501- describe ( "commit message is correctly handled" , ( ) => {
502- const testCommitMessage = async ( {
503- branch,
504- input,
505- expected,
506- } : {
507- branch : string ;
508- input : string | CommitMessage ;
509- expected : string ;
510- } ) => {
511- await commitFilesFromBuffers ( {
512- octokit,
513- ...REPO ,
514- branch,
515- base : {
516- commit : testTargetCommit ,
517- } ,
518- ...BASIC_FILE_CONTENTS ,
519- message : input ,
520- } ) ;
521-
522- await waitForGitHubToBeReady ( ) ;
523-
524- const ref = (
525- await getRefTreeQuery ( octokit , {
526- ...REPO ,
527- ref : `refs/heads/${ branch } ` ,
528- path : "package.json" ,
529- } )
530- ) . repository ?. ref ?. target ;
531-
532- if ( ! ref || ! ( "message" in ref ) ) {
533- throw new Error ( "Unexpected result" ) ;
534- }
535-
536- expect ( ref . message ) . toEqual ( expected ) ;
537- } ;
538-
539- it ( "single string" , async ( ) => {
540- const branch = `${ TEST_BRANCH_PREFIX } -commit-message-single` ;
541- branches . push ( branch ) ;
542-
543- await testCommitMessage ( {
544- branch,
545- input : "This is a basic commit message" ,
546- expected : "This is a basic commit message" ,
547- } ) ;
548- } ) ;
549-
550- it ( "multi-line string" , async ( ) => {
551- const branch = `${ TEST_BRANCH_PREFIX } -commit-message-multi` ;
552- branches . push ( branch ) ;
553-
554- await testCommitMessage ( {
555- branch,
556- input :
557- "This is a basic commit message\nwith a second line\n\nand some more lines!" ,
558- expected :
559- "This is a basic commit message\n\nwith a second line\n\nand some more lines!" ,
560- } ) ;
561- } ) ;
562-
563- it ( "headline only" , async ( ) => {
564- const branch = `${ TEST_BRANCH_PREFIX } -commit-message-h-only` ;
565- branches . push ( branch ) ;
566-
567- await testCommitMessage ( {
568- branch,
569- input : {
570- headline : "This is a basic commit message!!" ,
571- } ,
572- expected : "This is a basic commit message!!" ,
573- } ) ;
574- } ) ;
575-
576- it ( "headline & body" , async ( ) => {
577- const branch = `${ TEST_BRANCH_PREFIX } -commit-message-h-and-b` ;
578- branches . push ( branch ) ;
579-
580- await testCommitMessage ( {
581- branch,
582- input : {
583- headline : "This is a basic commit message!!" ,
584- body : "This is the body of the commit message\nit has more text" ,
585- } ,
586- expected :
587- "This is a basic commit message!!\n\nThis is the body of the commit message\nit has more text" ,
588- } ) ;
589- } ) ;
590- } ) ;
591499 } ) ;
592500
593501 afterAll ( async ( ) => {
0 commit comments