Skip to content

Commit 2698df8

Browse files
committed
chore: add version and constant test
1 parent 5779a05 commit 2698df8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ import './resource-embedding'
55
import './transforms'
66
import './rpc'
77
import './max-affected'
8+
import './version-and-constants.test'

test/version-and-constants.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { version } from '../src/version'
2+
import { DEFAULT_HEADERS } from '../src/constants'
3+
4+
describe('version', () => {
5+
test('should export version string', () => {
6+
expect(version).toBe('0.0.0-automated')
7+
})
8+
})
9+
10+
describe('constants', () => {
11+
test('should have X-Client-Info header with correct format', () => {
12+
expect(DEFAULT_HEADERS).toHaveProperty('X-Client-Info')
13+
expect(DEFAULT_HEADERS['X-Client-Info']).toBe(`postgrest-js/${version}`)
14+
})
15+
})

0 commit comments

Comments
 (0)