File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -18,5 +18,3 @@ services:
18
18
- MARIADB_ROOT_PASSWORD=root
19
19
ports :
20
20
- " 3306:3306"
21
- volumes :
22
- - ./config/init.sql:/docker-entrypoint-initdb.d/init.sql
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import chai from 'chai';
3
3
import nock from 'nock' ;
4
4
import path from 'node:path' ;
5
5
import { fileURLToPath } from 'node:url' ;
6
+ import type { Knex } from 'knex' ;
6
7
7
8
import { populateMemList } from '../src/lib/geoip/whitelist.js' ;
8
9
import {
@@ -11,7 +12,6 @@ import {
11
12
populateIpRangeList ,
12
13
populateNockCitiesList ,
13
14
} from './utils/populate-static-files.js' ;
14
-
15
15
import chaiOas from './plugins/oas/index.js' ;
16
16
import { getRedisClient , initRedis } from '../src/lib/redis/client.js' ;
17
17
import { client as sql } from '../src/lib/sql/client.js' ;
@@ -37,10 +37,10 @@ before(async () => {
37
37
await populateNockCitiesList ( ) ;
38
38
} ) ;
39
39
40
- const dropAllTables = async ( sql ) => {
40
+ const dropAllTables = async ( sql : Knex ) => {
41
41
const allTables = ( await sql ( 'information_schema.tables' )
42
42
. whereRaw ( `table_schema = database()` )
43
43
. select ( `table_name as table` )
44
- ) . map ( ( { table } ) => table ) ;
44
+ ) . map ( ( { table } : { table : string } ) => table ) ;
45
45
await Bluebird . map ( allTables , table => sql . schema . raw ( `drop table \`${ table } \`` ) ) ;
46
46
} ;
Original file line number Diff line number Diff line change
1
+ import type { Server } from 'node:http' ;
1
2
import nock from 'nock' ;
2
3
import { expect } from 'chai' ;
3
4
import * as sinon from 'sinon' ;
4
5
import type { Socket } from 'socket.io-client' ;
5
- import request from 'supertest' ;
6
+ import request , { type SuperTest , type Test } from 'supertest' ;
6
7
import { getTestServer , addFakeProbe , deleteFakeProbe } from '../../utils/server.js' ;
7
8
import nockGeoIpProviders from '../../utils/nock-geo-ip.js' ;
8
9
9
- let probe : Socket ;
10
- const app = await getTestServer ( ) ;
11
- const requestAgent = request ( app ) ;
12
- const adoptionCodeStub = sinon . stub ( ) ;
13
-
14
10
describe ( 'Adoption code' , ( ) => {
11
+ let app : Server ;
12
+ let requestAgent : SuperTest < Test > ;
13
+ let probe : Socket ;
14
+ const adoptionCodeStub = sinon . stub ( ) ;
15
+
15
16
before ( async ( ) => {
17
+ app = await getTestServer ( ) ;
18
+ requestAgent = request ( app ) ;
16
19
nockGeoIpProviders ( ) ;
17
20
18
21
probe = await addFakeProbe ( {
You can’t perform that action at this time.
0 commit comments