Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/query-core/src/__tests__/focusManager.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('focusManager', () => {

vi.advanceTimersByTime(20)
expect(count).toEqual(1)
expect(focusManager.isFocused()).toBeTruthy()
expect(focusManager.isFocused()).toBe(true)
})

it('should return true for isFocused if document is undefined', () => {
Expand All @@ -49,7 +49,7 @@ describe('focusManager', () => {
delete globalThis.document

focusManager.setFocused()
expect(focusManager.isFocused()).toBeTruthy()
expect(focusManager.isFocused()).toBe(true)
globalThis.document = document
})

Expand Down
6 changes: 3 additions & 3 deletions packages/query-core/src/__tests__/onlineManager.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('onlineManager', () => {
// Force navigator to be undefined
// @ts-expect-error
navigatorSpy.mockImplementation(() => undefined)
expect(onlineManager.isOnline()).toBeTruthy()
expect(onlineManager.isOnline()).toBe(true)

navigatorSpy.mockRestore()
})
Expand All @@ -28,7 +28,7 @@ describe('onlineManager', () => {
const navigatorSpy = vi.spyOn(navigator, 'onLine', 'get')
navigatorSpy.mockImplementation(() => true)

expect(onlineManager.isOnline()).toBeTruthy()
expect(onlineManager.isOnline()).toBe(true)

navigatorSpy.mockRestore()
})
Expand All @@ -48,7 +48,7 @@ describe('onlineManager', () => {

vi.advanceTimersByTime(20)
expect(count).toEqual(1)
expect(onlineManager.isOnline()).toBeFalsy()
expect(onlineManager.isOnline()).toBe(false)
})

it('setEventListener should call previous remove handler when replacing an event listener', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/query-core/src/__tests__/query.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ describe('query', () => {
const query = queryCache.find({ queryKey: key })!

query.invalidate()
expect(query.state.isInvalidated).toBeTruthy()
expect(query.state.isInvalidated).toBe(true)

const previousState = query.state

Expand Down
24 changes: 12 additions & 12 deletions packages/query-core/src/__tests__/queryClient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1781,8 +1781,8 @@ describe('queryClient', () => {
void observer1.mutate()
void observer2.mutate()

expect(observer1.getCurrentResult().isPaused).toBeTruthy()
expect(observer2.getCurrentResult().isPaused).toBeTruthy()
expect(observer1.getCurrentResult().isPaused).toBe(true)
expect(observer2.getCurrentResult().isPaused).toBe(true)

onlineManager.setOnline(true)

Expand Down Expand Up @@ -1816,8 +1816,8 @@ describe('queryClient', () => {
void observer1.mutate()
void observer2.mutate()

expect(observer1.getCurrentResult().isPaused).toBeTruthy()
expect(observer2.getCurrentResult().isPaused).toBeTruthy()
expect(observer1.getCurrentResult().isPaused).toBe(true)
expect(observer2.getCurrentResult().isPaused).toBe(true)

onlineManager.setOnline(true)

Expand Down Expand Up @@ -1861,8 +1861,8 @@ describe('queryClient', () => {
void observer1.mutate()
void observer2.mutate()

expect(observer1.getCurrentResult().isPaused).toBeTruthy()
expect(observer2.getCurrentResult().isPaused).toBeTruthy()
expect(observer1.getCurrentResult().isPaused).toBe(true)
expect(observer2.getCurrentResult().isPaused).toBe(true)

onlineManager.setOnline(true)
void queryClient.resumePausedMutations()
Expand All @@ -1885,12 +1885,12 @@ describe('queryClient', () => {

void observer.mutate()

expect(observer.getCurrentResult().isPaused).toBeTruthy()
expect(observer.getCurrentResult().isPaused).toBe(true)

await queryClient.resumePausedMutations()

// still paused because we are still offline
expect(observer.getCurrentResult().isPaused).toBeTruthy()
expect(observer.getCurrentResult().isPaused).toBe(true)

onlineManager.setOnline(true)

Expand All @@ -1909,7 +1909,7 @@ describe('queryClient', () => {

void observer.mutate()

expect(observer.getCurrentResult().isPaused).toBeTruthy()
expect(observer.getCurrentResult().isPaused).toBe(true)

const state = dehydrate(queryClient)

Expand Down Expand Up @@ -2004,9 +2004,9 @@ describe('queryClient', () => {

void observer3.mutate()

expect(observer.getCurrentResult().isPaused).toBeTruthy()
expect(observer2.getCurrentResult().isPaused).toBeTruthy()
expect(observer3.getCurrentResult().isPaused).toBeTruthy()
expect(observer.getCurrentResult().isPaused).toBe(true)
expect(observer2.getCurrentResult().isPaused).toBe(true)
expect(observer3.getCurrentResult().isPaused).toBe(true)
onlineManager.setOnline(true)

await vi.advanceTimersByTimeAsync(110)
Expand Down
10 changes: 5 additions & 5 deletions packages/query-core/src/__tests__/utils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('core/utils', () => {
})

it('should return `true` for object with an undefined constructor', () => {
expect(isPlainObject(Object.create(null))).toBeTruthy()
expect(isPlainObject(Object.create(null))).toBe(true)
})

it('should return `false` if constructor does not have an Object-specific method', () => {
Expand All @@ -89,7 +89,7 @@ describe('core/utils', () => {
this.abc = {}
}
}
expect(isPlainObject(new Foo())).toBeFalsy()
expect(isPlainObject(new Foo())).toBe(false)
})

it('should return `false` if the object has a modified prototype', () => {
Expand All @@ -102,15 +102,15 @@ describe('core/utils', () => {
this.vertices.push(v)
}

expect(isPlainObject(Object.create(Graph))).toBeFalsy()
expect(isPlainObject(Object.create(Graph))).toBe(false)
})

it('should return `false` for object with custom prototype', () => {
const CustomProto = Object.create({ a: 1 })
const obj = Object.create(CustomProto)
obj.b = 2

expect(isPlainObject(obj)).toBeFalsy()
expect(isPlainObject(obj)).toBe(false)
})
})

Expand Down Expand Up @@ -456,7 +456,7 @@ describe('core/utils', () => {
mutationCache: queryClient.getMutationCache(),
options: {},
})
expect(matchMutation(filters, mutation)).toBeFalsy()
expect(matchMutation(filters, mutation)).toBe(false)
})
})

Expand Down
Loading