Skip to content

Commit

Permalink
chore(test): fix linting and type errors (#5775)
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 authored Feb 16, 2024
1 parent 79ef8c3 commit 67ef631
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {describe, expect, it, jest} from '@jest/globals'

import {createIfNotExists} from '../../mutations'
import {type Migration, type NodeMigration} from '../../types'
import {
createAsyncIterableMutation,
normalizeMigrateDefinition,
} from '../normalizeMigrateDefinition'
import {Migration, NodeMigration} from '../../types'
import {createIfNotExists} from '../../mutations'

const mockAsyncIterableIterator = () => {
const data = [{_id: 'mockId', _type: 'mockDocumentType'}]
Expand Down Expand Up @@ -35,7 +37,7 @@ describe('#normalizeMigrateDefinition', () => {
const result = normalizeMigrateDefinition(mockMigration)

const res = []
for await (const item of result(jest.fn(), {} as any)) {
for await (const item of result(jest.fn() as any, {} as any)) {
res.push(item)
}

Expand All @@ -56,7 +58,7 @@ describe('#normalizeMigrateDefinition', () => {
const result = normalizeMigrateDefinition(mockMigration)
const res = []

for await (const item of result(mockAsyncIterableIterator, {} as any)) {
for await (const item of result(mockAsyncIterableIterator as any, {} as any)) {
res.push(item)
}

Expand All @@ -77,7 +79,7 @@ describe('#normalizeMigrateDefinition', () => {
const result = normalizeMigrateDefinition(mockMigration)
const res = []

for await (const item of result(mockAsyncIterableIterator, {} as any)) {
for await (const item of result(mockAsyncIterableIterator as any, {} as any)) {
res.push(item)
}

Expand All @@ -88,7 +90,7 @@ describe('#normalizeMigrateDefinition', () => {
describe('#createAsyncIterableMutation', () => {
it('should return an async iterable', async () => {
const mockMigration: NodeMigration = {
document: jest.fn(),
document: jest.fn() as any,
}

const iterable = createAsyncIterableMutation(mockMigration, {documentTypes: ['foo']})
Expand Down

0 comments on commit 67ef631

Please sign in to comment.