Skip to content

Commit b67bd0a

Browse files
committed
fix: ts compile errors
1 parent 1c2c356 commit b67bd0a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/generator.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const API_JSON1 = path.resolve(__dirname, './fixtures/library1.api.json')
88
const API_JSON2 = path.resolve(__dirname, './fixtures/utilities.api.json')
99
const model = new ApiModel()
1010
const API_MODEL_FILES = [API_JSON1, API_JSON2]
11-
const PACKAGES = API_MODEL_FILES.reduce((packages, file) => {
11+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
12+
const PACKAGES: any = API_MODEL_FILES.reduce((packages, file) => {
1213
return Object.assign(packages, { [file]: model.loadPackage(file) })
1314
}, {})
1415

@@ -23,7 +24,8 @@ jest.mock('../src/resolver/index', () => {
2324

2425
// mock 'utils' modules
2526
jest.mock('../src/utils', () => ({
26-
...jest.requireActual('../src/utils'),
27+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
28+
...jest.requireActual<any>('../src/utils'),
2729
mkdir: jest.fn(),
2830
writeFile: jest.fn()
2931
}))
@@ -43,6 +45,7 @@ test('generate prefix style contents', async () => {
4345

4446
expect(mkdir).toHaveBeenCalledTimes(7)
4547
expect(writeFile).toHaveBeenCalledTimes(7)
48+
// @ts-ignore TS2339: Property 'mock' does not exist on type '(path: string, data: string) => Promise<void>'.
4649
for (const arg of writeFile.mock.calls) {
4750
expect(
4851
[
@@ -76,6 +79,7 @@ test('generate directory style contents', async () => {
7679
path.resolve(output, './utilities/function.md')
7780
]
7881
expect(writeFile).toHaveBeenCalledTimes(7)
82+
// @ts-ignore TS2339: Property 'mock' does not exist on type '(path: string, data: string) => Promise<void>'.
7983
for (const arg of writeFile.mock.calls) {
8084
expect(passedArgs.includes(arg[0])).toBe(true)
8185
expect(arg[1]).toMatchSnapshot()

0 commit comments

Comments
 (0)