@hypequery/clickhouse 1.2.6 → 1.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Common initialization for all integration tests
3
+ * Import this at the beginning of each test file to ensure consistent setup
4
+ */
5
+ export declare const skipIntegrationTests: () => boolean;
6
+ export declare const initializeForTest: () => Promise<void>;
7
+ //# sourceMappingURL=test-initializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-initializer.d.ts","sourceRoot":"","sources":["../../../../src/core/tests/integration/test-initializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,eAAO,MAAM,oBAAoB,eAEhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,IAAI,CAqBtD,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Common initialization for all integration tests
3
+ * Import this at the beginning of each test file to ensure consistent setup
4
+ */
5
+ import { startClickHouseContainer, waitForClickHouse, ensureConnectionInitialized, setupTestDatabase } from './setup.js';
6
+ export const skipIntegrationTests = () => {
7
+ return process.env.SKIP_INTEGRATION_TESTS === 'true' || process.env.CI === 'true';
8
+ };
9
+ export const initializeForTest = async () => {
10
+ if (skipIntegrationTests()) {
11
+ return;
12
+ }
13
+ try {
14
+ // Initialize the connection
15
+ ensureConnectionInitialized();
16
+ // Make sure container is running
17
+ await startClickHouseContainer();
18
+ // Wait for ClickHouse to be ready
19
+ await waitForClickHouse();
20
+ // Set up the test database
21
+ await setupTestDatabase();
22
+ }
23
+ catch (error) {
24
+ console.error('Failed to initialize test environment:', error);
25
+ throw error;
26
+ }
27
+ };
28
+ // Automatically initialize when this module is imported
29
+ initializeForTest().catch(error => {
30
+ console.error('Test initialization failed:', error);
31
+ process.exit(1);
32
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypequery/clickhouse",
3
- "version": "1.2.6",
3
+ "version": "1.4.0-beta.1",
4
4
  "description": "ClickHouse typescript query builder",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",