Skip to content

Commit 00e7d6c

Browse files
committed
unsuccessful try to rewrite tests structure
1 parent f8e9acb commit 00e7d6c

File tree

168 files changed

+482
-172
lines changed

Some content is hidden

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

168 files changed

+482
-172
lines changed
File renamed without changes.

integration-tests/package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "integration-tests",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"license": "MIT",
6+
"scripts": {
7+
"test": "vitest --config ./vitest.config.ts",
8+
"test:bun": "bun test bun"
9+
},
10+
"dependencies": {
11+
"@arethetypeswrong/cli": "^0.16.4",
12+
"@cloudflare/workers-types": "^4.20250430.0",
13+
"@duckdb/node-api": "1.1.2-alpha.4",
14+
"@electric-sql/pglite": "^0.2.17",
15+
"@eslint/compat": "^1.2.7",
16+
"@eslint/eslintrc": "^3.3.1",
17+
"@eslint/js": "^9.23.0",
18+
"@libsql/client": "^0.15.4",
19+
"@libsql/client-wasm": "^0.15.4",
20+
"@miniflare/d1": "^2.14.4",
21+
"@miniflare/shared": "^2.14.4",
22+
"@neondatabase/serverless": "^1.0.0",
23+
"@op-engineering/op-sqlite": "^12.0.2",
24+
"@planetscale/database": "^1.19.0",
25+
"@tidbcloud/serverless": "^0.2.0",
26+
"@types/async-retry": "^1.4.9",
27+
"@types/better-sqlite3": "^7.6.13",
28+
"@types/bun": "^1.2.9",
29+
"@types/dockerode": "^3.3.35",
30+
"@types/node": "^22.15.3",
31+
"@types/pg": "^8.11.11",
32+
"@typescript-eslint/eslint-plugin": "^8.28.0",
33+
"@vercel/postgres": "^0.10.0",
34+
"@xata.io/client": "^0.30.1",
35+
"async-retry": "^1.3.3",
36+
"better-sqlite3": "^11.9.1",
37+
"bun-types": "^1.2.9",
38+
"chai": "^5.2.0",
39+
"concurrently": "^8.2.1",
40+
"dockerode": "^4.0.4",
41+
"dotenv": "^16.5.0",
42+
"dprint": "^0.46.2",
43+
"duckdb": "^1.2.1",
44+
"eslint": "^9.23.0",
45+
"eslint-plugin-import": "^2.31.0",
46+
"eslint-plugin-no-instanceof": "^1.0.1",
47+
"eslint-plugin-unicorn": "^56.0.1",
48+
"eslint-plugin-unused-imports": "^4.1.4",
49+
"expo-sqlite": "^15.2.9",
50+
"gel": "^2.0.2",
51+
"get-port": "^7.1.0",
52+
"mysql2": "^3.14.0",
53+
"pg": "^8.14.0",
54+
"postgres": "^3.4.5",
55+
"tsup": "^8.4.0",
56+
"tsx": "^4.19.1",
57+
"typescript": "^5.5.4",
58+
"vitest": "^3.1.1",
59+
"wrangler": "^4.13.0",
60+
"zx": "^8.1.9",
61+
"waddler": "workspace:../waddler/dist"
62+
}
63+
}

tests/common.test.ts renamed to integration-tests/tests/common.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { describe, expect, test } from 'vitest';
2-
import type { SQL as DuckdbSQL } from '../src/duckdb/index.ts';
3-
import { PgDialect } from '../src/pg/pg-core/dialect.ts';
4-
import { SQLDefault, SQLIdentifier, SQLRaw, SQLValues } from '../src/sql-template-params.ts';
5-
import type { SQL } from '../src/sql.ts';
6-
import { SQLWrapper } from '../src/sql.ts';
7-
import type { SQLParamType } from '../src/types.ts';
2+
import type { SQL as DuckdbSQL } from 'waddler/duckdb';
3+
// TODO should I export this in waddler?
4+
import type { SQL } from 'waddler';
5+
import { SQLWrapper } from 'waddler';
6+
import { PgDialect } from '../../waddler/src/pg/pg-core/dialect.ts';
7+
import { SQLDefault, SQLIdentifier, SQLRaw, SQLValues } from '../../waddler/src/sql-template-params.ts';
8+
import type { SQLParamType } from '../../waddler/src/types.ts';
89
import type { SqliteSQL } from './sqlite/sqlite-core';
910

1011
declare module 'vitest' {

tests/duckdb-neo/neo-waddler-unit.test.ts renamed to integration-tests/tests/duckdb-neo/neo-waddler-unit.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { commonTests } from 'tests/common.test';
2-
import { commonPgTests } from 'tests/pg/pg-core';
31
import { beforeAll, beforeEach, expect, test } from 'vitest';
4-
import type { SQL } from '../../src/duckdb-neo';
5-
import { waddler } from '../../src/duckdb-neo';
2+
import type { SQL } from 'waddler/duckdb-neo';
3+
import { waddler } from 'waddler/duckdb-neo';
4+
import { commonTests } from '../common.test';
5+
import { commonPgTests } from '../pg/pg-core';
66

77
let sql: ReturnType<typeof waddler>;
88
beforeAll(async () => {

tests/duckdb-neo/waddler-errors.test.ts renamed to integration-tests/tests/duckdb-neo/waddler-errors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import { waddler } from '../../src/duckdb-neo/driver.ts';
2+
import { waddler } from 'waddler/duckdb-neo';
33

44
test('error during connection test', async () => {
55
const sql = waddler({ url: 'md:?motherduck_token=test', max: 10, accessMode: 'read_write' });

tests/duckdb/waddler-unit.test.ts renamed to integration-tests/tests/duckdb/waddler-unit.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { commonTests } from 'tests/common.test';
2-
import { commonPgTests } from 'tests/pg/pg-core';
31
import { beforeAll, beforeEach, expect, test } from 'vitest';
4-
import type { SQL } from '../../src/duckdb';
5-
import { waddler } from '../../src/duckdb';
2+
import type { SQL } from 'waddler/duckdb';
3+
import { waddler } from 'waddler/duckdb';
4+
import { commonTests } from '../common.test';
5+
import { commonPgTests } from '../pg/pg-core';
66

77
let sql: SQL;
88
beforeAll(() => {
File renamed without changes.

tests/gel/waddler.test.ts renamed to integration-tests/tests/gel/waddler.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import type Docker from 'dockerode';
22
import type { Client } from 'gel';
33
import createClient, { DateDuration, Duration, LocalDate, LocalDateTime, LocalTime, RelativeDuration } from 'gel';
4-
import { commonTests } from 'tests/common.test.ts';
4+
import { afterAll, beforeAll, beforeEach, expect, test } from 'vitest';
5+
import type { SQL } from 'waddler';
6+
import { waddler } from 'waddler/gel';
7+
import { commonTests } from '../common.test.ts';
8+
import { createGelDockerDB } from '../utils.ts';
59
import {
610
createAllArrayDataTypesTable,
711
createAllDataTypesTable,
812
defaultValue,
913
dropAllDataTypesTable,
10-
} from 'tests/gel/gel-core.ts';
11-
import { createGelDockerDB } from 'tests/utils.ts';
12-
import { afterAll, beforeAll, beforeEach, expect, test } from 'vitest';
13-
import { waddler } from '../../src/gel';
14-
import type { SQL } from '../../src/sql.ts';
14+
} from './gel-core.ts';
1515
import 'zx/globals';
16-
import { commonPgTests } from 'tests/pg/pg-core.ts';
16+
import { commonPgTests } from '../pg/pg-core.ts';
1717

1818
let gelContainer: Docker.Container;
1919
let gelClient: Client;
@@ -27,7 +27,8 @@ let gelConnectionParams: {
2727
let gelConnectionString: string;
2828
let tlsSecurity: 'insecure';
2929

30-
let sql: SQL;
30+
// TODO: There should be just SQL, but it throws error; fix this in every test file
31+
let sql: ReturnType<typeof waddler>;
3132
beforeAll(async () => {
3233
const dockerPayload = await createGelDockerDB();
3334
const sleep = 1000;

tests/mysql/mysql-core.ts renamed to integration-tests/tests/mysql/mysql-core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test } from 'vitest';
2-
import type { SQL } from '~/sql';
2+
import type { SQL } from 'waddler';
33

44
export const createAllDataTypesTable = async (sql: SQL) => {
55
await sql.unsafe(`

tests/mysql/mysql2/waddler.test.ts renamed to integration-tests/tests/mysql/mysql2/waddler.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import type Docker from 'dockerode';
22
import mysqlCallback from 'mysql2';
33
import type { Connection } from 'mysql2/promise';
44
import mysql from 'mysql2/promise';
5-
import { commonTests } from 'tests/common.test';
5+
import { afterAll, beforeAll, beforeEach, expect, test } from 'vitest';
6+
import type { SQL } from 'waddler';
7+
import { waddler } from 'waddler/mysql2';
8+
import { commonTests } from '../../common.test';
69
import {
710
commonMysqlAllTypesTests,
811
commonMysqlTests,
912
createAllDataTypesTable,
1013
defaultValue,
1114
dropAllDataTypesTable,
12-
} from 'tests/mysql/mysql-core';
13-
import { createMysqlDockerDB } from 'tests/utils';
14-
import { afterAll, beforeAll, beforeEach, expect, test } from 'vitest';
15-
import type { SQL } from '~/sql';
16-
import { waddler } from '../../../src/mysql/mysql2';
15+
} from '../../mysql/mysql-core';
16+
import { createMysqlDockerDB } from '../../utils';
1717

1818
let mysqlContainer: Docker.Container;
1919
let mysqlClient: Connection;
@@ -25,7 +25,7 @@ let mysqlConnectionParams: {
2525
database: string;
2626
};
2727

28-
let sql: SQL;
28+
let sql: ReturnType<typeof waddler>;
2929
beforeAll(async () => {
3030
const dockerPayload = await createMysqlDockerDB();
3131
const sleep = 1000;

0 commit comments

Comments
 (0)