Skip to content

Commit

Permalink
chore(deps): update dependency @types/supertest to v6 (Unleash#5926)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
sjaanus and renovate[bot] authored Jan 17, 2024
1 parent 5fb2ac8 commit ee08bd8
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"@types/pg": "8.10.9",
"@types/semver": "7.5.6",
"@types/stoppable": "1.1.3",
"@types/supertest": "2.0.16",
"@types/supertest": "6.0.2",
"@types/type-is": "1.6.6",
"@types/uuid": "9.0.7",
"concurrently": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import createStores from '../../../../test/fixtures/store';
import getLogger from '../../../../test/fixtures/no-logger';
import getApp from '../../../app';
Expand All @@ -9,6 +9,7 @@ import { secondsToMilliseconds } from 'date-fns';
import { ClientSpecService } from '../../../services/client-spec-service';
import { Application } from 'express';
import { IFlagResolver } from '../../../types';
import TestAgent from 'supertest/lib/agent';

let app: Application;

Expand Down Expand Up @@ -41,7 +42,7 @@ const callGetAll = async (controller: FeatureController) => {
};

let base: string;
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;

let flagResolver: Partial<IFlagResolver>;

Expand Down
5 changes: 3 additions & 2 deletions src/lib/features/metrics/instance/metrics.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import getApp from '../../../app';
import { createTestConfig } from '../../../../test/config/test-config';
import { clientMetricsSchema } from '../shared/schema';
Expand All @@ -12,6 +12,7 @@ import {
import dbInit, { ITestDb } from '../../../../test/e2e/helpers/database-init';
import { subMinutes } from 'date-fns';
import { ApiTokenType } from '../../../types/models/api-token';
import TestAgent from 'supertest/lib/agent';

let db: ITestDb;

Expand All @@ -30,7 +31,7 @@ async function getSetup(opts?: IUnleashOptions) {
};
}

let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;
let stores: IUnleashStores;
let services: IUnleashServices;
let destroy: () => Promise<void>;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/features/metrics/instance/register.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import { createTestConfig } from '../../../../test/config/test-config';
import createStores from '../../../../test/fixtures/store';
import getLogger from '../../../../test/fixtures/no-logger';
import getApp from '../../../app';
import { createServices } from '../../../services';
import TestAgent from 'supertest/lib/agent';

async function getSetup() {
const stores = createStores();
Expand All @@ -16,7 +17,7 @@ async function getSetup() {
stores,
};
}
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;
beforeEach(async () => {
const setup = await getSetup();
request = setup.request;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/routes/admin-api/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import { createTestConfig } from '../../../test/config/test-config';

import createStores from '../../../test/fixtures/store';
Expand All @@ -8,6 +8,7 @@ import {
DEFAULT_SEGMENT_VALUES_LIMIT,
DEFAULT_STRATEGY_SEGMENTS_LIMIT,
} from '../../util/segments';
import TestAgent from 'supertest/lib/agent';

const uiConfig = {
headerBackground: 'red',
Expand All @@ -31,7 +32,7 @@ async function getSetup() {
};
}

let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;
let base: string;

beforeEach(async () => {
Expand Down
5 changes: 3 additions & 2 deletions src/lib/routes/admin-api/context.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import { createTestConfig } from '../../../test/config/test-config';
import createStores from '../../../test/fixtures/store';
import { createServices } from '../../services';
import permissions from '../../../test/fixtures/permissions';
import getApp from '../../app';
import TestAgent from 'supertest/lib/agent';

async function getSetup() {
const base = `/random${Math.round(Math.random() * 1000)}`;
Expand All @@ -24,7 +25,7 @@ async function getSetup() {
}

let base: string;
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;

beforeEach(async () => {
const setup = await getSetup();
Expand Down
5 changes: 3 additions & 2 deletions src/lib/routes/admin-api/metrics.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import createStores from '../../../test/fixtures/store';
import permissions from '../../../test/fixtures/permissions';
import getApp from '../../app';
import { createTestConfig } from '../../../test/config/test-config';
import { createServices } from '../../services';
import { IUnleashStores } from '../../types';
import TestAgent from 'supertest/lib/agent';

async function getSetup() {
const stores = createStores();
Expand All @@ -24,7 +25,7 @@ async function getSetup() {
}

let stores: IUnleashStores;
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;

beforeEach(async () => {
const setup = await getSetup();
Expand Down
5 changes: 3 additions & 2 deletions src/lib/routes/admin-api/public-signup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import createStores from '../../../test/fixtures/store';
import { createTestConfig } from '../../../test/config/test-config';
import { createServices } from '../../services';
import getApp from '../../app';
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import permissions from '../../../test/fixtures/permissions';
import { RoleName, RoleType } from '../../types/model';
import { IUnleashStores } from '../../types';
import TestAgent from 'supertest/lib/agent';

describe('Public Signup API', () => {
async function getSetup() {
Expand Down Expand Up @@ -38,7 +39,7 @@ describe('Public Signup API', () => {
}

let stores: IUnleashStores;
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;

const user = {
username: 'some-username',
Expand Down
5 changes: 3 additions & 2 deletions src/lib/routes/admin-api/tag.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import createStores from '../../../test/fixtures/store';
import permissions from '../../../test/fixtures/permissions';
import getApp from '../../app';
import { createTestConfig } from '../../../test/config/test-config';
import { createServices } from '../../services';
import { ITagStore } from '../../types';
import TestAgent from 'supertest/lib/agent';

async function getSetup() {
const base = `/random${Math.round(Math.random() * 1000)}`;
Expand All @@ -27,7 +28,7 @@ async function getSetup() {

let base: string;
let tagStore: ITagStore;
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;

beforeEach(async () => {
const setup = await getSetup();
Expand Down
5 changes: 3 additions & 2 deletions src/lib/routes/health-check.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import { createServices } from '../services';
import { createTestConfig } from '../../test/config/test-config';

import createStores from '../../test/fixtures/store';
import getLogger from '../../test/fixtures/no-logger';
import getApp from '../app';
import TestAgent from 'supertest/lib/agent';

async function getSetup() {
const stores = createStores();
Expand All @@ -17,7 +18,7 @@ async function getSetup() {
stores,
};
}
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;
beforeEach(async () => {
const setup = await getSetup();
request = setup.request;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/routes/public-invite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import createStores from '../../test/fixtures/store';
import { createTestConfig } from '../../test/config/test-config';
import { createServices } from '../services';
import getApp from '../app';
import supertest from 'supertest';
import supertest, { Test } from 'supertest';
import permissions from '../../test/fixtures/permissions';
import { RoleName, RoleType } from '../types/model';
import { IUnleashStores } from 'lib/types';
import TestAgent from 'supertest/lib/agent';

describe('Public Signup API', () => {
async function getSetup() {
Expand Down Expand Up @@ -51,7 +52,7 @@ describe('Public Signup API', () => {
}

let stores: IUnleashStores;
let request: supertest.SuperTest<supertest.Test>;
let request: TestAgent<Test>;

const user = {
username: 'some-username',
Expand Down
6 changes: 4 additions & 2 deletions src/test/e2e/helpers/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ import {
ImportTogglesSchema,
} from '../../../lib/openapi';
import { Knex } from 'knex';
import TestAgent from 'supertest/lib/agent';
import Test from 'supertest/lib/test';

process.env.NODE_ENV = 'test';

export interface IUnleashTest extends IUnleashHttpAPI {
request: supertest.SuperAgentTest;
request: TestAgent<Test>;
destroy: () => Promise<void>;
services: IUnleashServices;
config: IUnleashConfig;
Expand Down Expand Up @@ -108,7 +110,7 @@ export interface IUnleashHttpAPI {
}

function httpApis(
request: supertest.SuperAgentTest,
request: TestAgent<Test>,
config: IUnleashConfig,
): IUnleashHttpAPI {
const base = config.server.baseUriPath || '';
Expand Down
35 changes: 21 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1339,10 +1339,10 @@
dependencies:
"@types/node" "*"

"@types/cookiejar@*":
version "2.1.2"
resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.2.tgz#66ad9331f63fe8a3d3d9d8c6e3906dd10f6446e8"
integrity sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==
"@types/cookiejar@^2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.5.tgz#14a3e83fa641beb169a2dd8422d91c3c345a9a78"
integrity sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==

"@types/[email protected]":
version "2.8.17"
Expand Down Expand Up @@ -1488,6 +1488,11 @@
resolved "https://registry.yarnpkg.com/@types/memoizee/-/memoizee-0.4.11.tgz#da8897f0064bff3e845b5185e2a323bbd5c8d0a3"
integrity sha512-2gyorIBZu8GoDr9pYjROkxWWcFtHCquF7TVbN2I+/OvgZhnIGQS0vX5KJz4lXNKb8XOSfxFOSG5OLru1ESqLUg==

"@types/methods@^1.1.4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@types/methods/-/methods-1.1.4.tgz#d3b7ac30ac47c91054ea951ce9eed07b1051e547"
integrity sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==

"@types/mime@*":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10"
Expand Down Expand Up @@ -1608,20 +1613,22 @@
dependencies:
"@types/node" "*"

"@types/superagent@*":
version "4.1.16"
resolved "https://registry.yarnpkg.com/@types/superagent/-/superagent-4.1.16.tgz#12c9c16f232f9d89beab91d69368f96ce8e2d881"
integrity sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==
"@types/superagent@^8.1.0":
version "8.1.1"
resolved "https://registry.yarnpkg.com/@types/superagent/-/superagent-8.1.1.tgz#dbc620c5df3770b0c3092f947d6d5e808adae2bc"
integrity sha512-YQyEXA4PgCl7EVOoSAS3o0fyPFU6erv5mMixztQYe1bqbWmmn8c+IrqoxjQeZe4MgwXikgcaZPiI/DsbmOVlzA==
dependencies:
"@types/cookiejar" "*"
"@types/cookiejar" "^2.1.5"
"@types/methods" "^1.1.4"
"@types/node" "*"

"@types/supertest@2.0.16":
version "2.0.16"
resolved "https://registry.yarnpkg.com/@types/supertest/-/supertest-2.0.16.tgz#7a1294edebecb960d957bbe9b26002a2b7f21cd7"
integrity sha512-6c2ogktZ06tr2ENoZivgm7YnprnhYE4ZoXGMY+oA7IuAf17M8FWvujXZGmxLv8y0PTyts4x5A+erSwVUFA8XSg==
"@types/supertest@6.0.2":
version "6.0.2"
resolved "https://registry.yarnpkg.com/@types/supertest/-/supertest-6.0.2.tgz#2af1c466456aaf82c7c6106c6b5cbd73a5e86588"
integrity sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg==
dependencies:
"@types/superagent" "*"
"@types/methods" "^1.1.4"
"@types/superagent" "^8.1.0"

"@types/[email protected]":
version "1.6.6"
Expand Down

0 comments on commit ee08bd8

Please sign in to comment.