@@ -9,10 +9,9 @@ import {
99} from 'vitest' ;
1010
1111import problemMatcherData from '../.github/problem-matcher.json' ;
12- const problemMatcher = problemMatcherData . problemMatcher [ 0 ] ;
13-
1412import htmllintProblemMatcher from '../src/index' ;
1513
14+ const problemMatcher = problemMatcherData . problemMatcher [ 0 ] ;
1615const matchResults = function ( string , regexp ) {
1716 return string . map ( line => regexp . exec ( line ) ) ;
1817} ;
@@ -88,29 +87,29 @@ describe('loads JS', () => {
8887 } ) ;
8988
9089 it ( 'throws with no input' , async ( ) => {
91- await expect ( htmllintProblemMatcher ( ) ) . rejects . toThrowError ( ` Unsupported action ""` ) ;
90+ await expect ( htmllintProblemMatcher ( ) ) . rejects . toThrowError ( ' Unsupported action ""' ) ;
9291 } ) ;
9392} ) ;
9493
9594describe ( 'throws with invalid action' , ( ) => {
9695 beforeAll ( ( ) => {
97- process . env [ ' INPUT_ACTION' ] = 'foo' ;
96+ process . env . INPUT_ACTION = 'foo' ;
9897 } ) ;
9998 afterAll ( ( ) => {
100- delete process . env [ ' INPUT_ACTION' ] ;
99+ delete process . env . INPUT_ACTION ;
101100 } ) ;
102101
103102 it ( 'throws with invalid action' , async ( ) => {
104- await expect ( htmllintProblemMatcher ( ) ) . rejects . toThrowError ( ` Unsupported action "foo"` ) ;
103+ await expect ( htmllintProblemMatcher ( ) ) . rejects . toThrowError ( ' Unsupported action "foo"' ) ;
105104 } ) ;
106105} ) ;
107106
108107describe ( 'adds matcher' , ( ) => {
109108 beforeAll ( ( ) => {
110- process . env [ ' INPUT_ACTION' ] = 'add' ;
109+ process . env . INPUT_ACTION = 'add' ;
111110 } ) ;
112111 afterAll ( ( ) => {
113- delete process . env [ ' INPUT_ACTION' ] ;
112+ delete process . env . INPUT_ACTION ;
114113 } ) ;
115114
116115 it ( 'adds the matcher' , async ( ) => {
@@ -130,15 +129,16 @@ describe('adds matcher', () => {
130129 }
131130 }
132131 expect ( hasMatch ) . toBe ( true ) ;
132+ logMock . mockRestore ( ) ;
133133 } ) ;
134134} ) ;
135135
136136describe ( 'removes matcher' , ( ) => {
137137 beforeAll ( ( ) => {
138- process . env [ ' INPUT_ACTION' ] = 'remove' ;
138+ process . env . INPUT_ACTION = 'remove' ;
139139 } ) ;
140140 afterAll ( ( ) => {
141- delete process . env [ ' INPUT_ACTION' ] ;
141+ delete process . env . INPUT_ACTION ;
142142 } ) ;
143143
144144 it ( 'removes the matcher' , async ( ) => {
@@ -158,5 +158,6 @@ describe('removes matcher', () => {
158158 }
159159 }
160160 expect ( hasMatch ) . toBe ( true ) ;
161+ logMock . mockRestore ( ) ;
161162 } ) ;
162163} ) ;
0 commit comments