Skip to content

Commit

Permalink
Add a client.getVersion() test
Browse files Browse the repository at this point in the history
  • Loading branch information
eilvelia committed May 8, 2024
1 parent 39625e6 commit 670d294
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/integration/tdlib.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ describe(testName, () => {
if (pred(u)) return
}

// function versionGte (minMajor/*: number */, minMinor/*: number */) {
// const [major, minor] = client.getVersion().split('.').map(Number)
// if (major < minMajor) return false
// if (major > minMajor) return true
// return minor >= minMinor
// }

beforeAll(() => {
return expectUpdate(u => u._ === 'updateOption' && u.name === 'version')
}, 2000)
Expand All @@ -65,6 +58,12 @@ describe(testName, () => {
&& u?.authorization_state._ === 'authorizationStateWaitTdlibParameters')
}, 2000)

test('getVersion() returns a version string', () => {
const version = client.getVersion()
expect(version).toBeString()
expect(version).toStartWith('1.')
})

test('invoke(testCallString) should respond with the same value', async () => {
const response = await client.invoke({ _: 'testCallString', x: 'hi' })
await expect(response).toStrictEqual({ _: 'testString', value: 'hi' })
Expand Down

0 comments on commit 670d294

Please sign in to comment.