Skip to content
Merged
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
12 changes: 6 additions & 6 deletions src/tag.spec-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ test('tag function returns a tag factory when a callback is provided', () => {

const value = factory('foo')

expectTypeOf(value).toExtend<QueryTag<Unset>>()
expectTypeOf(value).toEqualTypeOf<QueryTag<Unset>>()
})

test('tag function returns a typed tag when data generic is provided', () => {
const value = tag<string>()

expectTypeOf(value).toExtend<QueryTag<string>>()
expectTypeOf(value).toEqualTypeOf<QueryTag<string>>()
})

test('tag factory returns a typed tag when data generic is provided', () => {
const factory = tag<string, string>((value: string) => value)

expectTypeOf(factory).toExtend<QueryTagFactory<string, string>>()
expectTypeOf(factory).toEqualTypeOf<QueryTagFactory<string, string>>()

const value = factory('foo')

expectTypeOf(value).toExtend<QueryTag<string>>()
expectTypeOf(value).toEqualTypeOf<QueryTag<string>>()
})

test('query from query function with tags callback is called with the query data', () => {
Expand All @@ -41,7 +41,7 @@ test('query from query function with tags callback is called with the query data

query(action, [], {
tags: (data) => {
expectTypeOf(data).toExtend<string>()
expectTypeOf(data).toEqualTypeOf<string>()

return []
},
Expand All @@ -54,7 +54,7 @@ test('query from query composition with tags callback is called with the query d

useQuery(action, () => [], {
tags: (data) => {
expectTypeOf(data).toExtend<string>()
expectTypeOf(data).toEqualTypeOf<string>()

return []
},
Expand Down