Skip to content

Commit

Permalink
Merge pull request #336 from n0th1ng-else/desp
Browse files Browse the repository at this point in the history
  • Loading branch information
n0th1ng-else authored Jul 9, 2023
2 parents 93c9c80 + e2ce296 commit ec071d2
Show file tree
Hide file tree
Showing 90 changed files with 8,416 additions and 1,788 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.14.0
18.16.1
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.14.0
FROM node:18.16.1

EXPOSE 8080

Expand Down
62 changes: 31 additions & 31 deletions e2e/dm.en.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import type { VoidPromise } from "../src/common/types.js";

jest.unstable_mockModule(
"../src/logger/index",
() => import("../src/logger/__mocks__/index.js")
() => import("../src/logger/__mocks__/index.js"),
);
jest.unstable_mockModule("../src/env", () => import("../src/__mocks__/env.js"));
jest.unstable_mockModule(
"../src/analytics/amplitude/index",
() => import("../src/analytics/amplitude/__mocks__/index.js")
() => import("../src/analytics/amplitude/__mocks__/index.js"),
);

const enableSSL = false;
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("[default language - english]", () => {

const converter = getVoiceConverterInstance(
getVoiceConverterProvider("GOOGLE"),
converterOptions
converterOptions,
);

const hostUrl = `${localhostUrl}:${appPort}`;
Expand Down Expand Up @@ -157,7 +157,7 @@ describe("[default language - english]", () => {
appPort,
enableSSL,
appVersion,
httpsOptions
httpsOptions,
);

testPool.mockQuery(NodesSql.createTable, () => Promise.resolve());
Expand Down Expand Up @@ -203,7 +203,7 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
LabelId.NoContent
LabelId.NoContent,
),
]);
});
Expand All @@ -219,7 +219,7 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
LabelId.NoContent
LabelId.NoContent,
),
]);
});
Expand All @@ -235,7 +235,7 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
LabelId.NoContent
LabelId.NoContent,
),
]);
});
Expand All @@ -255,7 +255,7 @@ describe("[default language - english]", () => {
LabelId.WelcomeMessageGroup,
LabelId.WelcomeMessageMore,
LabelId.DonateMessage,
]
],
),
]);
});
Expand All @@ -276,17 +276,17 @@ describe("[default language - english]", () => {
new TelegramMessageMetaItem(
TelegramMessageMetaType.Link,
LabelId.OfficialChannel,
officialChannelAccount
officialChannelAccount,
),
],
[
new TelegramMessageMetaItem(
TelegramMessageMetaType.Link,
LabelId.GithubIssues,
githubUrl
githubUrl,
),
],
]
],
),
]);
});
Expand All @@ -309,24 +309,24 @@ describe("[default language - english]", () => {
new TelegramMessageMetaItem(
TelegramMessageMetaType.Link,
LabelId.OfficialChannel,
officialChannelAccount
officialChannelAccount,
),
],
[
new TelegramMessageMetaItem(
TelegramMessageMetaType.Link,
LabelId.ContactAuthor,
authorUrl
authorUrl,
),
],
[
new TelegramMessageMetaItem(
TelegramMessageMetaType.Link,
LabelId.GithubIssues,
githubUrl
githubUrl,
),
],
]
],
),
]);
});
Expand All @@ -342,7 +342,7 @@ describe("[default language - english]", () => {
tgMessage.chatId,
statModel.langId,
LabelId.ChangeLangTitle,
getLangButtons()
getLangButtons(),
),
]);
});
Expand All @@ -358,7 +358,7 @@ describe("[default language - english]", () => {
tgMessage.chatId,
statModel.langId,
LabelId.ChangeLangTitle,
getLangButtons()
getLangButtons(),
),
]).then(([, prefixId]) => {
const cbMessage = new TelegramMessageModel(testChatId, chatType);
Expand All @@ -371,7 +371,7 @@ describe("[default language - english]", () => {
tgMessage.chatId,
cbMessage.messageId,
newLangId,
LabelId.ChangeLang
LabelId.ChangeLang,
),
mockUpdateBotStatLang(testPool, statModel, newLangId),
]);
Expand All @@ -389,7 +389,7 @@ describe("[default language - english]", () => {
tgMessage.chatId,
statModel.langId,
LabelId.FundCommandMessage,
getFundButtons()
getFundButtons(),
),
]);
});
Expand All @@ -411,13 +411,13 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
LabelId.InProgress
LabelId.InProgress,
),
mockTgReceiveRawMessage(
telegramServer,
tgMessage.chatId,
statModel.langId,
`🗣 ${voiceFileContent}`
`🗣 ${voiceFileContent}`,
),
mockUpdateBotStatUsage(testPool, statModel),
]).then(() => {
Expand All @@ -437,7 +437,7 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
[LabelId.LongVoiceMessage]
[LabelId.LongVoiceMessage],
),
]);
});
Expand All @@ -455,7 +455,7 @@ describe("[default language - english]", () => {
testMessageId,
voiceFileId,
voiceFileDuration,
"broken/type"
"broken/type",
);
const statModel = mockGetBotStatItem(testPool, tgMessage.chatId, "en-US");

Expand All @@ -469,7 +469,7 @@ describe("[default language - english]", () => {
LabelId.AudioNotSupportedMessage,
LabelId.SupportedFormatsMessage,
LabelId.SupportedFormatsMessageExplanation,
]
],
),
]);
});
Expand All @@ -485,7 +485,7 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
LabelId.NoContent
LabelId.NoContent,
),
]);
});
Expand All @@ -507,13 +507,13 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
LabelId.InProgress
LabelId.InProgress,
),
mockTgReceiveRawMessage(
telegramServer,
tgMessage.chatId,
statModel.langId,
`🗣 ${voiceFileContent}`
`🗣 ${voiceFileContent}`,
),
mockUpdateBotStatUsage(testPool, statModel),
]).then(() => {
Expand All @@ -533,7 +533,7 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
[LabelId.LongVoiceMessage]
[LabelId.LongVoiceMessage],
),
]);
});
Expand All @@ -545,7 +545,7 @@ describe("[default language - english]", () => {
testMessageId,
voiceFileId,
voiceFileDuration,
"broken/test"
"broken/test",
);
const statModel = mockGetBotStatItem(testPool, tgMessage.chatId, "en-US");

Expand All @@ -559,7 +559,7 @@ describe("[default language - english]", () => {
LabelId.AudioNotSupportedMessage,
LabelId.SupportedFormatsMessage,
LabelId.SupportedFormatsMessageExplanation,
]
],
),
]);
});
Expand All @@ -575,7 +575,7 @@ describe("[default language - english]", () => {
telegramServer,
tgMessage.chatId,
statModel.langId,
LabelId.NoContent
LabelId.NoContent,
),
]);
});
Expand Down
Loading

0 comments on commit ec071d2

Please sign in to comment.