mtcute/e2e/tests/01.auth.e2e.ts
alina sireneva af54f6e1c3
test(e2e): massive rework of e2e tests
now they run as-is, without any bundling. this might seem like a downgrade, but we no longer really need to verify that we publish stuff correctly as we delegate that to `@fuman/build`

meow
2024-12-07 09:08:30 +03:00

27 lines
737 B
TypeScript

import { describe, it } from 'node:test'
import { expect } from 'chai'
import { TelegramClient, User } from 'mtcute'
import { getApiParams } from './_utils.js'
describe('1. authorization', () => {
it('should authorize in default dc', async () => {
const tg = new TelegramClient(getApiParams('dc2.session'))
await tg.importSession(process.env.SESSION_DC2!)
expect(await tg.getMe()).to.be.instanceOf(User)
await tg.close()
})
it('should authorize in dc 1', async () => {
const tg = new TelegramClient(getApiParams('dc1.session'))
await tg.importSession(process.env.SESSION_DC1!)
expect(await tg.getMe()).to.be.instanceOf(User)
await tg.close()
})
})