mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 23:49:20 +01:00
Replace typescript compiler with native tsgo compiler
This commit is contained in:
@@ -14,7 +14,8 @@ import { createLogger } from '../../logging/log.std.js';
|
||||
|
||||
const logger = createLogger('uploadDebugLogs_test');
|
||||
|
||||
const gzip: (_: zlib.InputType) => Promise<Buffer> = util.promisify(zlib.gzip);
|
||||
const gzip: (_: zlib.InputType) => Promise<Buffer<ArrayBuffer>> =
|
||||
util.promisify(zlib.gzip);
|
||||
|
||||
describe('upload', () => {
|
||||
beforeEach(function (this: Mocha.Context) {
|
||||
|
||||
@@ -47,7 +47,10 @@ export function updateToVersion(db: WritableDB, version: number): void {
|
||||
}
|
||||
|
||||
type TableRows = ReadonlyArray<
|
||||
Record<string, string | number | Buffer | null | Record<string, unknown>>
|
||||
Record<
|
||||
string,
|
||||
string | number | Buffer<ArrayBuffer> | null | Record<string, unknown>
|
||||
>
|
||||
>;
|
||||
|
||||
export function insertData(
|
||||
|
||||
@@ -2457,7 +2457,7 @@ describe('SQL migrations test', () => {
|
||||
const payload = db.prepare('SELECT * FROM sendLogPayloads LIMIT 1;').get<{
|
||||
contentHint: number;
|
||||
timestamp: number;
|
||||
proto: Uint8Array;
|
||||
proto: Uint8Array<ArrayBuffer>;
|
||||
urgent: number;
|
||||
}>();
|
||||
|
||||
|
||||
@@ -446,7 +446,9 @@ describe('Attachment', () => {
|
||||
};
|
||||
|
||||
const expectedAttachmentData = Bytes.fromString('Above us only sky');
|
||||
const writeNewAttachmentData = async (attachmentData: Uint8Array) => {
|
||||
const writeNewAttachmentData = async (
|
||||
attachmentData: Uint8Array<ArrayBuffer>
|
||||
) => {
|
||||
assert.deepEqual(attachmentData, expectedAttachmentData);
|
||||
return FAKE_LOCAL_ATTACHMENT;
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ describe('Message', () => {
|
||||
logger: LoggerType;
|
||||
}) => new Blob(),
|
||||
makeObjectUrl: (
|
||||
_data: Uint8Array | ArrayBuffer,
|
||||
_data: Uint8Array<ArrayBuffer> | ArrayBuffer,
|
||||
_contentType: MIME.MIMEType
|
||||
) => 'fake-object-url',
|
||||
makeVideoScreenshot: async (_params: {
|
||||
@@ -86,14 +86,14 @@ describe('Message', () => {
|
||||
revokeObjectUrl: (_objectUrl: string) => undefined,
|
||||
readAttachmentData: async (
|
||||
attachment: Partial<AddressableAttachmentType>
|
||||
): Promise<Uint8Array> => {
|
||||
): Promise<Uint8Array<ArrayBuffer>> => {
|
||||
assert.strictEqual(attachment.version, 2);
|
||||
return Buffer.from('old data');
|
||||
},
|
||||
writeNewAttachmentData: async (_data: Uint8Array) => {
|
||||
writeNewAttachmentData: async (_data: Uint8Array<ArrayBuffer>) => {
|
||||
return FAKE_LOCAL_ATTACHMENT;
|
||||
},
|
||||
writeNewStickerData: async (_data: Uint8Array) => ({
|
||||
writeNewStickerData: async (_data: Uint8Array<ArrayBuffer>) => ({
|
||||
version: 2,
|
||||
path: 'fake-sticker-path',
|
||||
size: 1,
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('DelimitedStream', () => {
|
||||
}
|
||||
|
||||
async function strideTest(
|
||||
data: Uint8Array,
|
||||
data: Uint8Array<ArrayBuffer>,
|
||||
result: ReadonlyArray<string>
|
||||
): Promise<void> {
|
||||
// Just to keep reasonable run times
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('appendMacStream', () => {
|
||||
const stream = appendMacStream(macKey);
|
||||
stream.end(plaintext);
|
||||
|
||||
const chunks = new Array<Buffer>();
|
||||
const chunks = new Array<Buffer<ArrayBuffer>>();
|
||||
for await (const chunk of stream) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('prependStream', () => {
|
||||
const stream = prependStream(Buffer.from('prefix:'));
|
||||
stream.end('hello');
|
||||
|
||||
const chunks = new Array<Buffer>();
|
||||
const chunks = new Array<Buffer<ArrayBuffer>>();
|
||||
for await (const chunk of stream) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { sniffImageMimeType } from '../../util/sniffImageMimeType.std.js';
|
||||
|
||||
describe('sniffImageMimeType', () => {
|
||||
const fixture = (filename: string): Promise<Buffer> => {
|
||||
const fixture = (filename: string): Promise<Buffer<ArrayBuffer>> => {
|
||||
const fixturePath = path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
|
||||
@@ -20,13 +20,14 @@ export type LastRequestData = Readonly<{
|
||||
method?: string;
|
||||
url?: string;
|
||||
headers: OutgoingHttpHeaders;
|
||||
body: Buffer;
|
||||
body: Buffer<ArrayBuffer>;
|
||||
}>;
|
||||
|
||||
export class TestServer extends EventEmitter {
|
||||
#server: Server;
|
||||
#nextResponse: NextResponse = { status: 200, headers: {} };
|
||||
#lastRequest: { request: IncomingMessage; body: Buffer } | null = null;
|
||||
#lastRequest: { request: IncomingMessage; body: Buffer<ArrayBuffer> } | null =
|
||||
null;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
@@ -107,7 +108,7 @@ export class TestServer extends EventEmitter {
|
||||
|
||||
export function body(
|
||||
server: TestServer,
|
||||
steps: () => AsyncIterator<Uint8Array, void, number>
|
||||
steps: () => AsyncIterator<Uint8Array<ArrayBuffer>, void, number>
|
||||
): Readable {
|
||||
const iter = steps();
|
||||
let first = true;
|
||||
|
||||
Reference in New Issue
Block a user