refactor(core): Update supertest, and fix some typing errors (no-changelog) (#9527)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-05-31 09:40:03 +02:00
committed by GitHub
parent 47d774100b
commit 08902bf941
35 changed files with 148 additions and 143 deletions

View File

@@ -1,10 +0,0 @@
import superagent = require('superagent');
/**
* Make `SuperTest<T>` string-indexable.
*/
declare module 'supertest' {
interface SuperTest<T extends superagent.SuperAgentRequest>
extends superagent.SuperAgent<T>,
Record<string, any> {}
}

View File

@@ -1,6 +1,6 @@
import type { Application } from 'express';
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
import type { SuperAgentTest } from 'supertest';
import type TestAgent from 'supertest/lib/agent';
import type { Server } from 'http';
import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
@@ -44,12 +44,14 @@ export interface SetupProps {
quotas?: Partial<{ [K in NumericLicenseFeature]: number }>;
}
export type SuperAgentTest = TestAgent;
export interface TestServer {
app: Application;
httpServer: Server;
authAgentFor: (user: User) => SuperAgentTest;
publicApiAgentFor: (user: User) => SuperAgentTest;
authlessAgent: SuperAgentTest;
authAgentFor: (user: User) => TestAgent;
publicApiAgentFor: (user: User) => TestAgent;
authlessAgent: TestAgent;
license: LicenseMocker;
}