mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 02:18:15 +01:00
Bundle everything with rolldown
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import { assert } from 'chai';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { AbortableProcess } from '../../util/AbortableProcess.std.js';
|
||||
import { AbortableProcess } from '../../util/AbortableProcess.std.ts';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { BackOff } from '../../util/BackOff.std.js';
|
||||
import { BackOff } from '../../util/BackOff.std.ts';
|
||||
|
||||
describe('BackOff', () => {
|
||||
it('should return increasing timeouts', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import * as Bytes from '../../Bytes.std.js';
|
||||
import * as Bytes from '../../Bytes.std.ts';
|
||||
|
||||
describe('Bytes', () => {
|
||||
it('converts to base64 and back', () => {
|
||||
|
||||
@@ -4,26 +4,26 @@
|
||||
import { assert } from 'chai';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import { getMidnight } from '../../types/NotificationProfile.std.js';
|
||||
import { mapItemsIntoCollapseSets } from '../../util/CollapseSet.std.js';
|
||||
import { generateAci } from '../../types/ServiceId.std.js';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus.std.js';
|
||||
import { SeenStatus } from '../../MessageSeenStatus.std.js';
|
||||
import { DurationInSeconds } from '../../util/durations/duration-in-seconds.std.js';
|
||||
import { getMidnight } from '../../types/NotificationProfile.std.ts';
|
||||
import { mapItemsIntoCollapseSets } from '../../util/CollapseSet.std.ts';
|
||||
import { generateAci } from '../../types/ServiceId.std.ts';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus.std.ts';
|
||||
import { SeenStatus } from '../../MessageSeenStatus.std.ts';
|
||||
import { DurationInSeconds } from '../../util/durations/duration-in-seconds.std.ts';
|
||||
import {
|
||||
CallDirection,
|
||||
CallMode,
|
||||
CallType,
|
||||
DirectCallStatus,
|
||||
} from '../../types/CallDisposition.std.js';
|
||||
import { DAY } from '../../util/durations/constants.std.js';
|
||||
} from '../../types/CallDisposition.std.ts';
|
||||
import { DAY } from '../../util/durations/constants.std.ts';
|
||||
|
||||
import type { CallHistoryDetails } from '../../types/CallDisposition.std.js';
|
||||
import type { CallHistoryDetails } from '../../types/CallDisposition.std.ts';
|
||||
import type {
|
||||
MessageLookupType,
|
||||
MessageType,
|
||||
} from '../../state/ducks/conversations.preload.js';
|
||||
import type { CollapseSet } from '../../util/CollapseSet.std.js';
|
||||
} from '../../state/ducks/conversations.preload.ts';
|
||||
import type { CollapseSet } from '../../util/CollapseSet.std.ts';
|
||||
|
||||
describe('util/CollapseSets', () => {
|
||||
describe('mapItemsIntoCollapseSets', () => {
|
||||
|
||||
@@ -5,8 +5,8 @@ import { assert } from 'chai';
|
||||
import { Readable, Writable } from 'node:stream';
|
||||
import { pipeline } from 'node:stream/promises';
|
||||
|
||||
import { DelimitedStream } from '../../util/DelimitedStream.node.js';
|
||||
import { encodeDelimited } from '../../util/encodeDelimited.std.js';
|
||||
import { DelimitedStream } from '../../util/DelimitedStream.node.ts';
|
||||
import { encodeDelimited } from '../../util/encodeDelimited.std.ts';
|
||||
|
||||
describe('DelimitedStream', () => {
|
||||
function collect(out: Array<string>): Writable {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import { LatestQueue } from '../../util/LatestQueue.std.js';
|
||||
import { LatestQueue } from '../../util/LatestQueue.std.ts';
|
||||
|
||||
describe('LatestQueue', () => {
|
||||
it('if the queue is empty, new tasks are started immediately', done => {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { TaskDeduplicator } from '../../util/TaskDeduplicator.std.js';
|
||||
import { explodePromise } from '../../util/explodePromise.std.js';
|
||||
import { drop } from '../../util/drop.std.js';
|
||||
import { TaskDeduplicator } from '../../util/TaskDeduplicator.std.ts';
|
||||
import { explodePromise } from '../../util/explodePromise.std.ts';
|
||||
import { drop } from '../../util/drop.std.ts';
|
||||
|
||||
describe('TaskDeduplicator', () => {
|
||||
it('should run a task', async () => {
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
appendMacStream,
|
||||
MAC_KEY_SIZE,
|
||||
MAC_SIZE,
|
||||
} from '../../util/appendMacStream.node.js';
|
||||
import { generateConfigMatrix } from '../../util/generateConfigMatrix.std.js';
|
||||
} from '../../util/appendMacStream.node.ts';
|
||||
import { generateConfigMatrix } from '../../util/generateConfigMatrix.std.ts';
|
||||
|
||||
describe('appendMacStream', () => {
|
||||
generateConfigMatrix({
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { areObjectEntriesEqual } from '../../util/areObjectEntriesEqual.std.js';
|
||||
import { areObjectEntriesEqual } from '../../util/areObjectEntriesEqual.std.ts';
|
||||
|
||||
describe('areObjectEntriesEqual', () => {
|
||||
type TestObject = { foo?: number; bar?: number };
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { arePinnedConversationsEqual } from '../../util/arePinnedConversationsEqual.node.js';
|
||||
import { SignalService as Proto } from '../../protobuf/index.std.js';
|
||||
import { arePinnedConversationsEqual } from '../../util/arePinnedConversationsEqual.node.ts';
|
||||
import { SignalService as Proto } from '../../protobuf/index.std.ts';
|
||||
|
||||
import PinnedConversation = Proto.AccountRecord.PinnedConversation.Params;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert as chaiAssert } from 'chai';
|
||||
|
||||
import { assertDev, strictAssert } from '../../util/assert.std.js';
|
||||
import { assertDev, strictAssert } from '../../util/assert.std.ts';
|
||||
|
||||
describe('assert utilities', () => {
|
||||
describe('assert', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.js';
|
||||
import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.ts';
|
||||
|
||||
describe('assignWithNoUnnecessaryAllocation', () => {
|
||||
type Person = {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { MaybeAsyncIterable } from '../../util/asyncIterables.std.js';
|
||||
import { concat, wrapPromise } from '../../util/asyncIterables.std.js';
|
||||
import type { MaybeAsyncIterable } from '../../util/asyncIterables.std.ts';
|
||||
import { concat, wrapPromise } from '../../util/asyncIterables.std.ts';
|
||||
|
||||
describe('async iterable utilities', () => {
|
||||
describe('concat', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { awaitObject } from '../../util/awaitObject.std.js';
|
||||
import { awaitObject } from '../../util/awaitObject.std.ts';
|
||||
|
||||
describe('awaitObject', () => {
|
||||
it('returns correct result', async () => {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { assert } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import { createBatcher } from '../../util/batcher.std.js';
|
||||
import { sleep } from '../../util/sleep.std.js';
|
||||
import { createBatcher } from '../../util/batcher.std.ts';
|
||||
import { sleep } from '../../util/sleep.std.ts';
|
||||
|
||||
describe('batcher', () => {
|
||||
it('should schedule a full batch', async () => {
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { RecipientsByConversation } from '../../state/ducks/stories.preload.js';
|
||||
import type { ServiceIdString } from '../../types/ServiceId.std.js';
|
||||
import type { RecipientsByConversation } from '../../state/ducks/stories.preload.ts';
|
||||
import type { ServiceIdString } from '../../types/ServiceId.std.ts';
|
||||
|
||||
import { generateAci } from '../../types/ServiceId.std.js';
|
||||
import { generateStoryDistributionId } from '../../types/StoryDistributionId.std.js';
|
||||
import { generateAci } from '../../types/ServiceId.std.ts';
|
||||
import { generateStoryDistributionId } from '../../types/StoryDistributionId.std.ts';
|
||||
import {
|
||||
getAllServiceIds,
|
||||
filterServiceIds,
|
||||
} from '../../util/blockSendUntilConversationsAreVerified.dom.js';
|
||||
} from '../../util/blockSendUntilConversationsAreVerified.dom.ts';
|
||||
|
||||
describe('both/util/blockSendUntilConversationsAreVerified', () => {
|
||||
const SERVICE_ID_1 = generateAci();
|
||||
|
||||
@@ -8,12 +8,12 @@ import {
|
||||
getPeerIdFromConversation,
|
||||
getCallIdFromEra,
|
||||
getGroupCallMeta,
|
||||
} from '../../util/callDisposition.preload.js';
|
||||
} from '../../util/callDisposition.preload.ts';
|
||||
import {
|
||||
getDefaultConversation,
|
||||
getDefaultGroup,
|
||||
} from '../../test-helpers/getDefaultConversation.std.js';
|
||||
import { uuidToBytes } from '../../util/uuidToBytes.std.js';
|
||||
} from '../../test-helpers/getDefaultConversation.std.ts';
|
||||
import { uuidToBytes } from '../../util/uuidToBytes.std.ts';
|
||||
|
||||
const MOCK_ERA = 'abc';
|
||||
const MOCK_CALL_ID = '16919744041952114874';
|
||||
|
||||
@@ -6,11 +6,11 @@ import { assert } from 'chai';
|
||||
import {
|
||||
callLinkToRecord,
|
||||
callLinkFromRecord,
|
||||
} from '../../util/callLinksRingrtc.node.js';
|
||||
} from '../../util/callLinksRingrtc.node.ts';
|
||||
import {
|
||||
FAKE_CALL_LINK as CALL_LINK,
|
||||
FAKE_CALL_LINK_WITH_ADMIN_KEY as CALL_LINK_WITH_ADMIN_KEY,
|
||||
} from '../../test-helpers/fakeCallLink.std.js';
|
||||
} from '../../test-helpers/fakeCallLink.std.ts';
|
||||
|
||||
describe('callLinks', () => {
|
||||
it('callLinkToRecord() and callLinkFromRecord() can convert to record and back', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getParticipantName } from '../../util/callingGetParticipantName.std.js';
|
||||
import { getParticipantName } from '../../util/callingGetParticipantName.std.ts';
|
||||
|
||||
describe('getParticipantName', () => {
|
||||
it('returns the first name if available', () => {
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
HangupType,
|
||||
OpaqueMessage,
|
||||
} from '@signalapp/ringrtc';
|
||||
import { SignalService as Proto } from '../../protobuf/index.std.js';
|
||||
import { SignalService as Proto } from '../../protobuf/index.std.ts';
|
||||
|
||||
import { callingMessageToProto } from '../../util/callingMessageToProto.node.js';
|
||||
import { callingMessageToProto } from '../../util/callingMessageToProto.node.ts';
|
||||
|
||||
describe('callingMessageToProto', () => {
|
||||
// NOTE: These tests are incomplete.
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { getCallingNotificationText } from '../../util/callingNotification.std.js';
|
||||
import { getCallingNotificationText } from '../../util/callingNotification.std.ts';
|
||||
import {
|
||||
CallMode,
|
||||
CallDirection,
|
||||
CallType,
|
||||
GroupCallStatus,
|
||||
} from '../../types/CallDisposition.std.js';
|
||||
import i18n from './i18n.node.js';
|
||||
} from '../../types/CallDisposition.std.ts';
|
||||
import i18n from './i18n.node.ts';
|
||||
import {
|
||||
getDefaultConversation,
|
||||
getDefaultGroup,
|
||||
} from '../../test-helpers/getDefaultConversation.std.js';
|
||||
import { getPeerIdFromConversation } from '../../util/callDisposition.preload.js';
|
||||
import { HOUR } from '../../util/durations/index.std.js';
|
||||
} from '../../test-helpers/getDefaultConversation.std.ts';
|
||||
import { getPeerIdFromConversation } from '../../util/callDisposition.preload.ts';
|
||||
import { HOUR } from '../../util/durations/index.std.ts';
|
||||
|
||||
describe('calling notification helpers', () => {
|
||||
describe('getCallingNotificationText', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { count } from '../../util/characters.std.js';
|
||||
import { count } from '../../util/characters.std.ts';
|
||||
|
||||
describe('character utilities', () => {
|
||||
describe('count', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.std.js';
|
||||
import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.std.ts';
|
||||
|
||||
describe('clearTimeoutIfNecessary', () => {
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { combineNames } from '../../util/combineNames.std.js';
|
||||
import { combineNames } from '../../util/combineNames.std.ts';
|
||||
|
||||
describe('combineNames', () => {
|
||||
it('returns undefined if no names provided', () => {
|
||||
|
||||
@@ -12,16 +12,16 @@ import {
|
||||
countAllConversationsUnreadStats,
|
||||
countConversationUnreadStats,
|
||||
isConversationUnread,
|
||||
} from '../../util/countUnreadStats.std.js';
|
||||
} from '../../util/countUnreadStats.std.ts';
|
||||
import type {
|
||||
UnreadStats,
|
||||
ConversationPropsForUnreadStats,
|
||||
UnreadStatsIncludeMuted,
|
||||
} from '../../util/countUnreadStats.std.js';
|
||||
import type { CurrentChatFolder } from '../../types/CurrentChatFolders.std.js';
|
||||
import { CurrentChatFolders } from '../../types/CurrentChatFolders.std.js';
|
||||
import type { ChatFolderId } from '../../types/ChatFolder.std.js';
|
||||
import { CHAT_FOLDER_DEFAULTS } from '../../types/ChatFolder.std.js';
|
||||
} from '../../util/countUnreadStats.std.ts';
|
||||
import type { CurrentChatFolder } from '../../types/CurrentChatFolders.std.ts';
|
||||
import { CurrentChatFolders } from '../../types/CurrentChatFolders.std.ts';
|
||||
import type { ChatFolderId } from '../../types/ChatFolder.std.ts';
|
||||
import { CHAT_FOLDER_DEFAULTS } from '../../types/ChatFolder.std.ts';
|
||||
|
||||
function getFutureMutedTimestamp() {
|
||||
return Date.now() + 12345;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { createSupportUrl } from '../../util/createSupportUrl.std.js';
|
||||
import { createSupportUrl } from '../../util/createSupportUrl.std.ts';
|
||||
|
||||
describe('createSupportUrl', () => {
|
||||
it('returns support url for "en" locale', () => {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
toHumanDonationAmount,
|
||||
toHumanCurrencyString,
|
||||
toStripeDonationAmount,
|
||||
} from '../../util/currency.dom.js';
|
||||
} from '../../util/currency.dom.ts';
|
||||
|
||||
describe('parseCurrencyString', () => {
|
||||
function testFn(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { deconstructLookup } from '../../util/deconstructLookup.std.js';
|
||||
import { deconstructLookup } from '../../util/deconstructLookup.std.ts';
|
||||
|
||||
describe('deconstructLookup', () => {
|
||||
it('looks up an array of properties in a lookup', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { diffArraysAsSets } from '../../util/diffArraysAsSets.std.js';
|
||||
import { diffArraysAsSets } from '../../util/diffArraysAsSets.std.ts';
|
||||
|
||||
function assertMatch<T>({
|
||||
added,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { dropNull, shallowDropNull } from '../../util/dropNull.std.js';
|
||||
import { dropNull, shallowDropNull } from '../../util/dropNull.std.ts';
|
||||
|
||||
type Test = {
|
||||
a: number | null;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { replaceEmojiWithSpaces, splitByEmoji } from '../../util/emoji.std.js';
|
||||
import { replaceEmojiWithSpaces, splitByEmoji } from '../../util/emoji.std.ts';
|
||||
|
||||
describe('emoji', () => {
|
||||
describe('replaceEmojiWithSpaces', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { makeEnumParser } from '../../util/enum.std.js';
|
||||
import { makeEnumParser } from '../../util/enum.std.ts';
|
||||
|
||||
describe('enum utils', () => {
|
||||
describe('makeEnumParser', () => {
|
||||
|
||||
@@ -5,11 +5,11 @@ import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { assert } from 'chai';
|
||||
import * as moment from 'moment';
|
||||
import { setupI18n } from '../../util/setupI18n.dom.js';
|
||||
import { DurationInSeconds } from '../../util/durations/index.std.js';
|
||||
import type { LocaleMessagesType } from '../../types/I18N.std.js';
|
||||
import { setupI18n } from '../../util/setupI18n.dom.tsx';
|
||||
import { DurationInSeconds } from '../../util/durations/index.std.ts';
|
||||
import type { LocaleMessagesType } from '../../types/I18N.std.ts';
|
||||
|
||||
import * as expirationTimer from '../../util/expirationTimer.std.js';
|
||||
import * as expirationTimer from '../../util/expirationTimer.std.ts';
|
||||
|
||||
function loadMessages(locale: string): LocaleMessagesType {
|
||||
const localePath = join(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { explodePromise } from '../../util/explodePromise.std.js';
|
||||
import { explodePromise } from '../../util/explodePromise.std.ts';
|
||||
|
||||
describe('explodePromise', () => {
|
||||
it('resolves the promise', async () => {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import * as durations from '../../util/durations/index.std.js';
|
||||
import * as durations from '../../util/durations/index.std.ts';
|
||||
|
||||
import {
|
||||
exponentialBackoffSleepTime,
|
||||
exponentialBackoffMaxAttempts,
|
||||
} from '../../util/exponentialBackoff.std.js';
|
||||
} from '../../util/exponentialBackoff.std.ts';
|
||||
|
||||
describe('exponential backoff utilities', () => {
|
||||
describe('exponentialBackoffSleepTime', () => {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import lodash from 'lodash';
|
||||
import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js';
|
||||
import { filterAndSortConversations } from '../../util/filterAndSortConversations.std.js';
|
||||
import type { ConversationType } from '../../state/ducks/conversations.preload.js';
|
||||
import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.ts';
|
||||
import { filterAndSortConversations } from '../../util/filterAndSortConversations.std.ts';
|
||||
import type { ConversationType } from '../../state/ducks/conversations.preload.ts';
|
||||
|
||||
const { pick } = lodash;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { assert } from 'chai';
|
||||
import { Readable } from 'node:stream';
|
||||
import { pipeline } from 'node:stream/promises';
|
||||
|
||||
import { finalStream } from '../../util/finalStream.node.js';
|
||||
import { finalStream } from '../../util/finalStream.node.ts';
|
||||
|
||||
describe('finalStream', () => {
|
||||
it('should invoke callback before pipeline resolves', async () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { generateConfigMatrix } from '../../util/generateConfigMatrix.std.js';
|
||||
import { generateConfigMatrix } from '../../util/generateConfigMatrix.std.ts';
|
||||
|
||||
describe('generateConfigMatrix', () => {
|
||||
it('generates an empty list', () => {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { getRandomColor } from '../../test-helpers/getRandomColor.std.js';
|
||||
import { getRandomColor } from '../../test-helpers/getRandomColor.std.ts';
|
||||
|
||||
import { getAvatarData } from '../../util/getAvatarData.dom.js';
|
||||
import { getAvatarData } from '../../util/getAvatarData.dom.ts';
|
||||
|
||||
describe('getAvatarData', () => {
|
||||
it('returns existing avatars if present', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { getClassNamesFor } from '../../util/getClassNamesFor.std.js';
|
||||
import { getClassNamesFor } from '../../util/getClassNamesFor.std.ts';
|
||||
|
||||
describe('getClassNamesFor', () => {
|
||||
it('returns a function', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getCustomColorStyle } from '../../util/getCustomColorStyle.dom.js';
|
||||
import { getCustomColorStyle } from '../../util/getCustomColorStyle.dom.ts';
|
||||
|
||||
describe('getCustomColorStyle', () => {
|
||||
it('returns undefined if no color passed in', () => {
|
||||
|
||||
@@ -6,8 +6,8 @@ import { assert } from 'chai';
|
||||
import {
|
||||
fontSniffer,
|
||||
getFontNameByTextScript,
|
||||
} from '../../util/getFontNameByTextScript.std.js';
|
||||
import { setupI18n } from '../../util/setupI18n.dom.js';
|
||||
} from '../../util/getFontNameByTextScript.std.ts';
|
||||
import { setupI18n } from '../../util/setupI18n.dom.tsx';
|
||||
|
||||
describe('getFontNameByTextScript', () => {
|
||||
it('has arabic', () => {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import type { ConversationType } from '../../state/ducks/conversations.preload.js';
|
||||
import { generateAci } from '../../types/ServiceId.std.js';
|
||||
import { normalizeAci } from '../../util/normalizeAci.std.js';
|
||||
import type { ServiceIdString } from '../../types/ServiceId.std.js';
|
||||
import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.std.js';
|
||||
import type { ConversationType } from '../../state/ducks/conversations.preload.ts';
|
||||
import { generateAci } from '../../types/ServiceId.std.ts';
|
||||
import { normalizeAci } from '../../util/normalizeAci.std.ts';
|
||||
import type { ServiceIdString } from '../../types/ServiceId.std.ts';
|
||||
import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.std.ts';
|
||||
|
||||
import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js';
|
||||
import { getGroupMemberships } from '../../util/getGroupMemberships.dom.ts';
|
||||
|
||||
describe('getGroupMemberships', () => {
|
||||
const normalConversation1 = getDefaultConversationWithServiceId();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getHSL } from '../../util/getHSL.std.js';
|
||||
import { getHSL } from '../../util/getHSL.std.ts';
|
||||
|
||||
describe('getHSL', () => {
|
||||
it('returns expected lightness values', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getInitials } from '../../util/getInitials.std.js';
|
||||
import { getInitials } from '../../util/getInitials.std.ts';
|
||||
|
||||
describe('getInitials', () => {
|
||||
it('returns undefined when passed undefined', () => {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
import i18n from './i18n.node.js';
|
||||
import i18n from './i18n.node.ts';
|
||||
|
||||
import { getMuteOptions } from '../../util/getMuteOptions.std.js';
|
||||
import { getMuteOptions } from '../../util/getMuteOptions.std.ts';
|
||||
|
||||
describe('getMuteOptions', () => {
|
||||
const HOUR = 3600000;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
import i18n from './i18n.node.js';
|
||||
import i18n from './i18n.node.ts';
|
||||
|
||||
import { getMutedUntilText } from '../../util/getMutedUntilText.std.js';
|
||||
import { getMutedUntilText } from '../../util/getMutedUntilText.std.ts';
|
||||
|
||||
describe('getMutedUntilText', () => {
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getOwn } from '../../util/getOwn.std.js';
|
||||
import { getOwn } from '../../util/getOwn.std.ts';
|
||||
|
||||
describe('getOwn', () => {
|
||||
class Person {
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as sinon from 'sinon';
|
||||
import lodash from 'lodash';
|
||||
import { once } from 'node:events';
|
||||
|
||||
import { getStreamWithTimeout } from '../../util/getStreamWithTimeout.node.js';
|
||||
import { getStreamWithTimeout } from '../../util/getStreamWithTimeout.node.ts';
|
||||
|
||||
const { noop } = lodash;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { assert } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import { getUserAgent } from '../../util/getUserAgent.node.js';
|
||||
import { getUserAgent } from '../../util/getUserAgent.node.ts';
|
||||
|
||||
describe('getUserAgent', () => {
|
||||
beforeEach(function (this: Mocha.Context) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.std.js';
|
||||
import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.std.ts';
|
||||
|
||||
describe('graphemeAndLinkAwareSlice', () => {
|
||||
it('returns entire string when shorter than maximum', () => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
count,
|
||||
hasAtMostGraphemes,
|
||||
isSingleGrapheme,
|
||||
} from '../../util/grapheme.std.js';
|
||||
} from '../../util/grapheme.std.ts';
|
||||
|
||||
describe('grapheme utilities', () => {
|
||||
describe('getGraphemes', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { groupWhile, formatGroups } from '../../util/groupWhile.std.js';
|
||||
import { groupWhile, formatGroups } from '../../util/groupWhile.std.ts';
|
||||
|
||||
describe('groupWhile/formatGroups', () => {
|
||||
function check(
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js';
|
||||
import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.ts';
|
||||
|
||||
import {
|
||||
dehydrateCollisionsWithConversations,
|
||||
getCollisionsFromMemberships,
|
||||
hasUnacknowledgedCollisions,
|
||||
invertIdsByTitle,
|
||||
} from '../../util/groupMemberNameCollisions.std.js';
|
||||
} from '../../util/groupMemberNameCollisions.std.ts';
|
||||
|
||||
describe('group member name collision utilities', () => {
|
||||
describe('dehydrateCollisionsWithConversations', () => {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import { validateGroupSendEndorsementsExpiration } from '../../util/groupSendEndorsements.preload.js';
|
||||
import { DAY, HOUR, SECOND } from '../../util/durations/index.std.js';
|
||||
import { validateGroupSendEndorsementsExpiration } from '../../util/groupSendEndorsements.preload.ts';
|
||||
import { DAY, HOUR, SECOND } from '../../util/durations/index.std.ts';
|
||||
|
||||
describe('groupSendEndorsements', () => {
|
||||
describe('validateGroupSendEndorsementsExpiration', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { hslToRGB, hslToRGBInt } from '../../util/hslToRGB.std.js';
|
||||
import { hslToRGB, hslToRGBInt } from '../../util/hslToRGB.std.ts';
|
||||
|
||||
describe('hslToRGB', () => {
|
||||
it('converts pure rgb colors', () => {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
import { setupI18n } from '../../util/setupI18nMain.std.js';
|
||||
import { shouldNeverBeCalled } from '../../util/shouldNeverBeCalled.std.js';
|
||||
import { setupI18n } from '../../util/setupI18nMain.std.ts';
|
||||
import { shouldNeverBeCalled } from '../../util/shouldNeverBeCalled.std.ts';
|
||||
|
||||
const PATH = join(
|
||||
__dirname,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isConversationMuted } from '../../util/isConversationMuted.std.js';
|
||||
import { isConversationMuted } from '../../util/isConversationMuted.std.ts';
|
||||
|
||||
describe('isConversationMuted', () => {
|
||||
it('returns false if passed an undefined expiry time', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isConversationNameKnown } from '../../util/isConversationNameKnown.std.js';
|
||||
import { isConversationNameKnown } from '../../util/isConversationNameKnown.std.ts';
|
||||
|
||||
describe('isConversationNameKnown', () => {
|
||||
describe('for direct conversations', () => {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { generateAci } from '../../types/ServiceId.std.js';
|
||||
import { generateAci } from '../../types/ServiceId.std.ts';
|
||||
|
||||
import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.std.js';
|
||||
import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.std.ts';
|
||||
|
||||
const serviceId = generateAci();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isConversationUnread } from '../../util/isConversationUnread.std.js';
|
||||
import { isConversationUnread } from '../../util/isConversationUnread.std.ts';
|
||||
|
||||
describe('isConversationUnread', () => {
|
||||
it('returns false if both markedUnread and unreadCount are undefined', () => {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { generateAci } from '../../types/ServiceId.std.js';
|
||||
import * as durations from '../../util/durations/index.std.js';
|
||||
import { generateAci } from '../../types/ServiceId.std.ts';
|
||||
import * as durations from '../../util/durations/index.std.ts';
|
||||
|
||||
import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js';
|
||||
import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.ts';
|
||||
|
||||
const serviceId = generateAci();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isFileDangerous } from '../../util/isFileDangerous.std.js';
|
||||
import { isFileDangerous } from '../../util/isFileDangerous.std.ts';
|
||||
|
||||
describe('isFileDangerous', () => {
|
||||
it('returns false for images', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isInSystemContacts } from '../../util/isInSystemContacts.std.js';
|
||||
import { isInSystemContacts } from '../../util/isInSystemContacts.std.ts';
|
||||
|
||||
describe('isInSystemContacts', () => {
|
||||
it('returns true for direct conversations that have a `name` property', () => {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus.std.js';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus.std.ts';
|
||||
|
||||
import { isMessageUnread } from '../../util/isMessageUnread.std.js';
|
||||
import { isMessageUnread } from '../../util/isMessageUnread.std.ts';
|
||||
|
||||
describe('isMessageUnread', () => {
|
||||
it("returns false if the message's `readStatus` field is undefined", () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isNormalNumber } from '../../util/isNormalNumber.std.js';
|
||||
import { isNormalNumber } from '../../util/isNormalNumber.std.ts';
|
||||
|
||||
describe('isNormalNumber', () => {
|
||||
it('returns false for non-numbers', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isNotNil } from '../../util/isNotNil.std.js';
|
||||
import { isNotNil } from '../../util/isNotNil.std.ts';
|
||||
|
||||
describe('isNotNil', () => {
|
||||
it('returns false if provided null value', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isPathInside } from '../../util/isPathInside.node.js';
|
||||
import { isPathInside } from '../../util/isPathInside.node.ts';
|
||||
|
||||
describe('isPathInside', () => {
|
||||
it('returns false if the child path is not inside the parent path', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isRecord } from '../../util/isRecord.std.js';
|
||||
import { isRecord } from '../../util/isRecord.std.ts';
|
||||
|
||||
describe('isRecord', () => {
|
||||
it('returns false for primitives', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isSorted } from '../../util/isSorted.std.js';
|
||||
import { isSorted } from '../../util/isSorted.std.ts';
|
||||
|
||||
describe('isSorted', () => {
|
||||
it('returns true for empty lists', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isValidE164 } from '../../util/isValidE164.std.js';
|
||||
import { isValidE164 } from '../../util/isValidE164.std.ts';
|
||||
|
||||
describe('isValidE164', () => {
|
||||
it('returns false for non-strings', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isValidUuid } from '../../util/isValidUuid.std.js';
|
||||
import { isValidUuid } from '../../util/isValidUuid.std.ts';
|
||||
|
||||
describe('isValidUuid', () => {
|
||||
const LOWERCASE_V4_UUID = '9cb737ce-2bb3-4c21-9fe0-d286caa0ca68';
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
size,
|
||||
take,
|
||||
zipObject,
|
||||
} from '../../util/iterables.std.js';
|
||||
} from '../../util/iterables.std.ts';
|
||||
|
||||
describe('iterable utilities', () => {
|
||||
describe('isIterable', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert, AssertionError } from 'chai';
|
||||
import { parseNumber } from '../../util/libphonenumberUtil.std.js';
|
||||
import { parseNumber } from '../../util/libphonenumberUtil.std.ts';
|
||||
|
||||
describe('libphonenumber util', () => {
|
||||
describe('parseNumber', () => {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { assert } from 'chai';
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
import { appendPaddingStream } from '../../util/logPadding.node.js';
|
||||
import { logPadSize } from '../../util/logPadSize.std.js';
|
||||
import { appendPaddingStream } from '../../util/logPadding.node.ts';
|
||||
import { logPadSize } from '../../util/logPadSize.std.ts';
|
||||
|
||||
const BUCKET_SIZES = [
|
||||
541, 568, 596, 626, 657, 690, 725, 761, 799, 839, 881, 925, 972, 1020, 1071,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { makeLookup } from '../../util/makeLookup.std.js';
|
||||
import { makeLookup } from '../../util/makeLookup.std.ts';
|
||||
|
||||
describe('makeLookup', () => {
|
||||
it('returns an empty object if passed an empty array', () => {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import * as sinon from 'sinon';
|
||||
import assert from 'node:assert/strict';
|
||||
import type { MapEmplaceOptions } from '../../util/mapEmplace.std.js';
|
||||
import { mapEmplace } from '../../util/mapEmplace.std.js';
|
||||
import type { MapEmplaceOptions } from '../../util/mapEmplace.std.ts';
|
||||
import { mapEmplace } from '../../util/mapEmplace.std.ts';
|
||||
|
||||
type InsertFn = NonNullable<MapEmplaceOptions<Map<object, object>>['insert']>;
|
||||
type UpdateFn = NonNullable<MapEmplaceOptions<Map<object, object>>['update']>;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { mapObjectWithSpec } from '../../util/mapObjectWithSpec.std.js';
|
||||
import { mapObjectWithSpec } from '../../util/mapObjectWithSpec.std.ts';
|
||||
|
||||
describe('mapObjectWithSpec', () => {
|
||||
const increment = (value: number) => value + 1;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { assert } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import { groupBy, isEqual } from '../../util/mapUtil.std.js';
|
||||
import { groupBy, isEqual } from '../../util/mapUtil.std.ts';
|
||||
|
||||
describe('map utilities', () => {
|
||||
describe('groupBy', () => {
|
||||
|
||||
@@ -6,22 +6,22 @@ import lodash from 'lodash';
|
||||
import type { CustomError } from '../../textsecure/Types.d.ts';
|
||||
|
||||
import type { MessageAttributesType } from '../../model-types.d.ts';
|
||||
import { createLogger } from '../../logging/log.std.js';
|
||||
import * as Errors from '../../types/errors.std.js';
|
||||
import { NotificationType } from '../../types/notifications.std.js';
|
||||
import { createLogger } from '../../logging/log.std.ts';
|
||||
import * as Errors from '../../types/errors.std.ts';
|
||||
import { NotificationType } from '../../types/notifications.std.ts';
|
||||
import {
|
||||
getChangesForPropAtTimestamp,
|
||||
getPropForTimestamp,
|
||||
} from '../../util/editHelpers.std.js';
|
||||
} from '../../util/editHelpers.std.ts';
|
||||
import {
|
||||
isSent,
|
||||
SendActionType,
|
||||
sendStateReducer,
|
||||
someRecipientSendStatus,
|
||||
} from '../../messages/MessageSendState.std.js';
|
||||
import { isStory } from '../../messages/helpers.std.js';
|
||||
import { notificationService } from '../../services/notifications.preload.js';
|
||||
import type { MessageModel } from '../../models/messages.preload.js';
|
||||
} from '../../messages/MessageSendState.std.ts';
|
||||
import { isStory } from '../../messages/helpers.std.ts';
|
||||
import { notificationService } from '../../services/notifications.preload.ts';
|
||||
import type { MessageModel } from '../../models/messages.preload.ts';
|
||||
|
||||
const { mapValues, pick } = lodash;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { normalizeDeviceName } from '../../util/normalizeDeviceName.std.js';
|
||||
import { normalizeDeviceName } from '../../util/normalizeDeviceName.std.ts';
|
||||
|
||||
describe('normalizeDeviceName', () => {
|
||||
it('leaves normal device names untouched', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { parseIntOrThrow } from '../../util/parseIntOrThrow.std.js';
|
||||
import { parseIntOrThrow } from '../../util/parseIntOrThrow.std.ts';
|
||||
|
||||
describe('parseIntOrThrow', () => {
|
||||
describe('when passed a number argument', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { parseIntWithFallback } from '../../util/parseIntWithFallback.std.js';
|
||||
import { parseIntWithFallback } from '../../util/parseIntWithFallback.std.ts';
|
||||
|
||||
describe('parseIntWithFallback', () => {
|
||||
describe('when passed a number argument', () => {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { MINUTE } from '../../util/durations/index.std.js';
|
||||
import { MINUTE } from '../../util/durations/index.std.ts';
|
||||
|
||||
import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.std.js';
|
||||
import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.std.ts';
|
||||
|
||||
describe('parseRetryAfter', () => {
|
||||
it('should return 1 minute when passed non-strings', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { prependStream } from '../../util/prependStream.node.js';
|
||||
import { prependStream } from '../../util/prependStream.node.ts';
|
||||
|
||||
describe('prependStream', () => {
|
||||
it('should prepend stream with a prefix', async () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import * as Privacy from '../../util/privacy.node.js';
|
||||
import * as Privacy from '../../util/privacy.node.ts';
|
||||
|
||||
Privacy.addSensitivePath('sensitive-path');
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ import type {
|
||||
EditHistoryType,
|
||||
MessageAttributesType,
|
||||
} from '../../model-types.d.ts';
|
||||
import type { AttachmentType } from '../../types/Attachment.std.js';
|
||||
import { IMAGE_JPEG, LONG_MESSAGE } from '../../types/MIME.std.js';
|
||||
import { generateMessageId } from '../../util/generateMessageId.node.js';
|
||||
import { ensureBodyAttachmentsAreSeparated } from '../../util/queueAttachmentDownloads.preload.js';
|
||||
import { createLogger } from '../../logging/log.std.js';
|
||||
import type { AttachmentType } from '../../types/Attachment.std.ts';
|
||||
import { IMAGE_JPEG, LONG_MESSAGE } from '../../types/MIME.std.ts';
|
||||
import { generateMessageId } from '../../util/generateMessageId.node.ts';
|
||||
import { ensureBodyAttachmentsAreSeparated } from '../../util/queueAttachmentDownloads.preload.ts';
|
||||
import { createLogger } from '../../logging/log.std.ts';
|
||||
|
||||
const logger = createLogger('queueAttachmentDownloads_test');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { reallyJsonStringify } from '../../util/reallyJsonStringify.std.js';
|
||||
import { reallyJsonStringify } from '../../util/reallyJsonStringify.std.ts';
|
||||
|
||||
describe('reallyJsonStringify', () => {
|
||||
it('returns the same thing as JSON.stringify when JSON.stringify returns a string', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { replaceIndex } from '../../util/replaceIndex.std.js';
|
||||
import { replaceIndex } from '../../util/replaceIndex.std.ts';
|
||||
|
||||
describe('replaceIndex', () => {
|
||||
it('returns a new array with an index replaced', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import { resolveCanonicalLocales } from '../../util/resolveCanonicalLocales.std.js';
|
||||
import { resolveCanonicalLocales } from '../../util/resolveCanonicalLocales.std.ts';
|
||||
|
||||
describe('resolveCanonicalLocales', () => {
|
||||
it('returns an array of canonical locales', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { rgbIntToHSL, rgbToHSL } from '../../util/rgbToHSL.std.js';
|
||||
import { rgbIntToHSL, rgbToHSL } from '../../util/rgbToHSL.std.ts';
|
||||
|
||||
describe('rgbToHSL', () => {
|
||||
it('converts pure rgb colors', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { nonRenderedRemoteParticipant } from '../../../util/ringrtc/nonRenderedRemoteParticipant.std.js';
|
||||
import { nonRenderedRemoteParticipant } from '../../../util/ringrtc/nonRenderedRemoteParticipant.std.ts';
|
||||
|
||||
describe('nonRenderedRemoteParticipant', () => {
|
||||
it('returns a video request object a width and height of 0', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { normalizeGroupCallTimestamp } from '../../../util/ringrtc/normalizeGroupCallTimestamp.std.js';
|
||||
import { normalizeGroupCallTimestamp } from '../../../util/ringrtc/normalizeGroupCallTimestamp.std.ts';
|
||||
|
||||
describe('normalizeGroupCallTimestamp', () => {
|
||||
it('returns undefined if passed a string that cannot be parsed as a number', () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
parseStrict,
|
||||
parseUnknown,
|
||||
SchemaParseError,
|
||||
} from '../../util/schemas.std.js';
|
||||
} from '../../util/schemas.std.ts';
|
||||
|
||||
describe('schemas', () => {
|
||||
const schema = z.object({ prop: z.literal('value') });
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js';
|
||||
import { searchConversationTitles } from '../../util/searchConversationTitles.std.js';
|
||||
import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.ts';
|
||||
import { searchConversationTitles } from '../../util/searchConversationTitles.std.ts';
|
||||
|
||||
describe('searchContactTitles', () => {
|
||||
const conversations = [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { generateSnippetAroundMention } from '../../util/search.std.js';
|
||||
import { generateSnippetAroundMention } from '../../util/search.std.ts';
|
||||
|
||||
describe('generateSnippetAroundMention', () => {
|
||||
it('generates snippet around mention at start of body', () => {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { getServerAlertToShow } from '../../util/handleServerAlerts.preload.js';
|
||||
import { ServerAlert } from '../../types/ServerAlert.std.js';
|
||||
import { DAY, MONTH, WEEK } from '../../util/durations/index.std.js';
|
||||
import { getServerAlertToShow } from '../../util/handleServerAlerts.preload.ts';
|
||||
import { ServerAlert } from '../../types/ServerAlert.std.ts';
|
||||
import { DAY, MONTH, WEEK } from '../../util/durations/index.std.ts';
|
||||
|
||||
describe('serverAlerts', () => {
|
||||
it('should prefer critical alerts', () => {
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import * as Bytes from '../../Bytes.std.js';
|
||||
import type { LocalUserDataType } from '../../util/sessionTranslation.node.js';
|
||||
import { sessionRecordToProtobuf } from '../../util/sessionTranslation.node.js';
|
||||
import * as Bytes from '../../Bytes.std.ts';
|
||||
import type { LocalUserDataType } from '../../util/sessionTranslation.node.ts';
|
||||
import { sessionRecordToProtobuf } from '../../util/sessionTranslation.node.ts';
|
||||
|
||||
import { toNumber } from '../../util/toNumber.std.js';
|
||||
import { toNumber } from '../../util/toNumber.std.ts';
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const getRecordCopy = (record: any): any => JSON.parse(JSON.stringify(record));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { difference, isEqual, remove, toggle } from '../../util/setUtil.std.js';
|
||||
import { difference, isEqual, remove, toggle } from '../../util/setUtil.std.ts';
|
||||
|
||||
describe('set utilities', () => {
|
||||
const original = new Set([1, 2, 3]);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { assert } from 'chai';
|
||||
import type { ParsedSignalRoute } from '../../util/signalRoutes.std.js';
|
||||
import type { ParsedSignalRoute } from '../../util/signalRoutes.std.ts';
|
||||
import {
|
||||
isSignalRoute,
|
||||
parseSignalRoute,
|
||||
toSignalRouteAppUrl,
|
||||
toSignalRouteUrl,
|
||||
toSignalRouteWebUrl,
|
||||
} from '../../util/signalRoutes.std.js';
|
||||
} from '../../util/signalRoutes.std.ts';
|
||||
|
||||
describe('signalRoutes', () => {
|
||||
type CheckConfig = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user