fix(e2e): storage import

This commit is contained in:
alina 🌸 2023-12-01 15:03:11 +03:00
parent c42c629475
commit e22aed56af
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
3 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,5 @@
const { MemoryStorage } = require('@mtcute/core/storage/memory.js')
exports.getApiParams = () => { exports.getApiParams = () => {
if (!process.env.API_ID || !process.env.API_HASH) { if (!process.env.API_ID || !process.env.API_HASH) {
throw new Error('API_ID and API_HASH env variables must be set') throw new Error('API_ID and API_HASH env variables must be set')
@ -7,5 +9,6 @@ exports.getApiParams = () => {
apiId: parseInt(process.env.API_ID), apiId: parseInt(process.env.API_ID),
apiHash: process.env.API_HASH, apiHash: process.env.API_HASH,
testMode: true, testMode: true,
storage: new MemoryStorage(),
} }
} }

View file

@ -1,3 +1,5 @@
import { MemoryStorage } from '@mtcute/core/storage/memory.js'
export const getApiParams = () => { export const getApiParams = () => {
if (!process.env.API_ID || !process.env.API_HASH) { if (!process.env.API_ID || !process.env.API_HASH) {
throw new Error('API_ID and API_HASH env variables must be set') throw new Error('API_ID and API_HASH env variables must be set')
@ -7,5 +9,6 @@ export const getApiParams = () => {
apiId: parseInt(process.env.API_ID), apiId: parseInt(process.env.API_ID),
apiHash: process.env.API_HASH, apiHash: process.env.API_HASH,
testMode: true, testMode: true,
storage: new MemoryStorage(),
} }
} }

View file

@ -1,4 +1,5 @@
import { BaseTelegramClientOptions } from '@mtcute/core' import { BaseTelegramClientOptions } from '@mtcute/core'
import { MemoryStorage } from '@mtcute/core/storage/memory.js'
export const getApiParams = (): BaseTelegramClientOptions => { export const getApiParams = (): BaseTelegramClientOptions => {
if (!process.env.API_ID || !process.env.API_HASH) { if (!process.env.API_ID || !process.env.API_HASH) {
@ -9,5 +10,6 @@ export const getApiParams = (): BaseTelegramClientOptions => {
apiId: parseInt(process.env.API_ID), apiId: parseInt(process.env.API_ID),
apiHash: process.env.API_HASH, apiHash: process.env.API_HASH,
testMode: true, testMode: true,
storage: new MemoryStorage(),
} }
} }