Skip to content

Commit 40641ee

Browse files
authored
chore: remove legacy tests (#4102)
* chore: remove legacy tests * chore: move files * chore: remove unused methods * chore: remove unused options * docs: adjust command
1 parent 2b0325b commit 40641ee

File tree

332 files changed

+299
-10313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+299
-10313
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
},
2424
{
25-
"files": "test/esm/**/*.mts",
25+
"files": "test/**/*.mts",
2626
"options": {
2727
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
2828
"importOrder": [

Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ FILTER='timeout' npm test
128128
```
129129

130130
> [!TIP]
131-
> You can also run a single test by performing `node ./test/path-to-test-file`.
131+
> You can also run a single test by performing `tsx ./test/path-to-test-file`.
132132
133133
For testing **coverage**:
134134

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default [
145145
},
146146
},
147147
{
148-
files: ['test/esm/**/*.mts'],
148+
files: ['test/**/*.mts'],
149149
rules: {
150150
'@typescript-eslint/no-unused-vars': 'off',
151151
'@typescript-eslint/no-unsafe-function-type': 'off',

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
"lint": "eslint . && prettier --check .",
1010
"lint:fix": "eslint . --fix && prettier --write .",
1111
"test": "npm run test:parallel && npm run test:global",
12-
"test:parallel": "poku -c=\"poku.config.mjs\" test/esm",
13-
"test:global": "cross-env SUITE=global poku -c=\"poku.config.mjs\" test/esm/global",
12+
"test:parallel": "poku -c=\"poku.config.mjs\" test",
13+
"test:global": "cross-env SUITE=global poku -c=\"poku.config.mjs\" test/global",
1414
"test:bun": "npm run test:bun:parallel",
15-
"test:bun:parallel": "bun poku -c=\"poku.config.mjs\" test/esm",
15+
"test:bun:parallel": "bun poku -c=\"poku.config.mjs\" test",
1616
"test:deno": "npm run test:deno:parallel && npm run test:deno:global",
17-
"test:deno:parallel": "deno run --allow-read --allow-env --allow-run npm:poku@canary -c=\"poku.config.mjs\" test/esm",
18-
"test:deno:global": "cross-env SUITE=global deno run --allow-read --allow-env --allow-run npm:poku@canary -c=\"poku.config.mjs\" test/esm/global",
17+
"test:deno:parallel": "deno run --allow-read --allow-env --allow-run npm:poku@canary -c=\"poku.config.mjs\" test",
18+
"test:deno:global": "cross-env SUITE=global deno run --allow-read --allow-env --allow-run npm:poku@canary -c=\"poku.config.mjs\" test/global",
1919
"test:docker:up": "docker compose -f test/docker-compose.yml up --abort-on-container-exit --remove-orphans",
2020
"test:docker:down": "docker compose -f test/docker-compose.yml down",
2121
"test:docker:node": "npm run test:docker:up -- node && npm run test:docker:down",
2222
"test:docker:bun": "npm run test:docker:up -- bun && npm run test:docker:down",
2323
"test:docker:deno": "npm run test:docker:up -- deno && npm run test:docker:down",
2424
"test:docker:coverage": "npm run test:docker:up -- coverage && npm run test:docker:down",
2525
"test:coverage": "c8 npm test",
26-
"typecheck": "cd \"test/tsc-build\" && tsc -p \"tsconfig.json\" && cd ../esm && tsc -p \"tsconfig.json\" --noEmit",
26+
"typecheck": "cd \"test/tsc-build\" && tsc -p \"tsconfig.json\" && cd .. && tsc -p \"tsconfig.json\" --noEmit",
2727
"benchmark": "node ./benchmarks/benchmark.js",
2828
"wait-port": "wait-on"
2929
},

poku.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const commonConfig = defineConfig({
1111

1212
const parallel = defineConfig({
1313
...commonConfig,
14-
exclude: [/test[\\/]esm[\\/]global/],
14+
exclude: [/test[\\/]global/, /test[\\/]tsc-build/],
1515
concurrency: 8,
1616
});
1717

test/common.test.cjs

Lines changed: 0 additions & 279 deletions
This file was deleted.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import type {
33
ConnectionOptions,
44
PoolClusterOptions,
55
PoolOptions,
6-
} from '../../index.js';
6+
} from '../index.js';
77
import type {
88
Connection as PromiseConnection,
99
RowDataPacket,
10-
} from '../../promise.js';
10+
} from '../promise.js';
1111
import fs from 'node:fs';
1212
import { createRequire } from 'node:module';
1313
import path from 'node:path';
1414
import process from 'node:process';
1515
import { fileURLToPath } from 'node:url';
16-
import driver from '../../index.js';
17-
import ClientFlags from '../../lib/constants/client.js';
16+
import driver from '../index.js';
17+
import ClientFlags from '../lib/constants/client.js';
1818

1919
export * as SqlString from 'sql-escaper';
2020

@@ -50,7 +50,7 @@ if (process.env.MYSQL_USE_TLS === '1') {
5050
config.ssl = {
5151
rejectUnauthorized: false,
5252
ca: fs.readFileSync(
53-
path.join(__dirname, '../../test/fixtures/ssl/certs/ca.pem'),
53+
path.join(__dirname, 'fixtures/ssl/certs/ca.pem'),
5454
'utf-8'
5555
),
5656
};
@@ -229,7 +229,7 @@ export const createConnectionWithURI = function (): ReturnType<
229229

230230
export const createTemplate = function () {
231231
const jade = require('jade');
232-
const template = fs.readFileSync(`${__dirname}/../template.jade`, 'ascii');
232+
const template = fs.readFileSync(`${__dirname}/template.jade`, 'ascii');
233233

234234
return jade.compile(template);
235235
};

test/esm/global/test-backpressure-load-data-infile.test.mts renamed to test/global/test-backpressure-load-data-infile.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import type {
22
QueryError,
33
ResultSetHeader,
44
RowDataPacket,
5-
} from '../../../index.js';
5+
} from '../../index.js';
66
import Net from 'node:net';
77
import { Duplex, Readable } from 'node:stream';
88
import { assert, log, skip, sleep, test } from 'poku';
9-
import driver from '../../../index.js';
9+
import driver from '../../index.js';
1010
import { config } from '../common.test.mjs';
1111

1212
if (config.compress) {

0 commit comments

Comments
 (0)