Skip to content

Commit

Permalink
chore(test): add test for explicit perspective=raw
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Jan 31, 2025
1 parent 3928514 commit 82f3033
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {expect, test} from 'vitest'

import {endpoints} from '../endpoints'
import {toFetchOptions} from '../sanityRequestOptions'

test('toFetchOptions', () => {
expect(
toFetchOptions({
projectId: 'xyz',
apiVersion: 'v2025-01-31',
apiHost: 'api.sanity.io',
endpoint: endpoints.data.query('my-dataset'),
}),
).toEqual({
init: {
headers: {
'Content-Type': 'application/json',
'User-Agent': '@sanity/[email protected]',
},
method: 'GET',
},
url: 'https://xyz.api.sanity.io//v2025-01-31/query/my-dataset?perspective=raw',
})
})

0 comments on commit 82f3033

Please sign in to comment.