Skip to content

Commit f1211a3

Browse files
committed
Fix tests to import
1 parent 037dda2 commit f1211a3

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

__tests__/annotation.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { expect } from '@jest/globals'
1+
import { jest } from '@jest/globals'
22
import { Annotation } from '../src/annotation.js'
33

44
describe('annotation.ts', () => {
5+
afterEach(() => {
6+
jest.resetAllMocks()
7+
})
8+
59
it('test Annotation.constructor with Warning', () => {
610
const annotation = new Annotation(
711
'Warning',

__tests__/main.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { jest } from '@jest/globals'
22
import * as path from 'path'
33
import { fileURLToPath } from 'url'
4-
import { expect } from '@jest/globals'
54
import * as core from '../__fixtures__/core.js'
65

76
jest.unstable_mockModule('@actions/core', () => core)

__tests__/parser.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
import { jest } from '@jest/globals'
12
import * as path from 'path'
23
import { fileURLToPath } from 'url'
3-
import { expect } from '@jest/globals'
44
import { Annotation } from '../src/annotation.js'
55
import { parseXmls, parseXml } from '../src/parser.js'
66

77
describe('parser.ts', () => {
88
const __dirname = path.dirname(fileURLToPath(import.meta.url))
99

10+
afterEach(() => {
11+
jest.resetAllMocks()
12+
})
13+
1014
it('test parseXmls', async () => {
1115
const file1 = path.join(__dirname, 'resource', 'lint-results.xml')
1216
const file2 = path.join(__dirname, 'resource', 'empty-results.xml')

0 commit comments

Comments
 (0)