Skip to content

Commit cb39843

Browse files
committed
clean up tests
1 parent 8875f06 commit cb39843

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

packages/runtime/src/client/executor/zenstack-query-executor.ts

+7-18
Original file line numberDiff line numberDiff line change
@@ -160,27 +160,16 @@ export class ZenStackQueryExecutor<
160160

161161
private async proceedQuery(query: RootOperationNode, queryId: QueryId) {
162162
// run built-in transformers
163-
console.log('Name mapping', this.compileQuery(query).sql);
164163
const finalQuery = this.nameMapper.transformNode(query);
165-
// const finalQuery = query;
166164

167165
const compiled = this.compileQuery(finalQuery);
168-
try {
169-
return await (this.driver.txConnection
170-
? super
171-
.withConnectionProvider(
172-
new SingleConnectionProvider(this.driver.txConnection)
173-
)
174-
.executeQuery<any>(compiled, queryId)
175-
: super.executeQuery<any>(compiled, queryId));
176-
} catch (err) {
177-
console.error(
178-
`Failed to execute query: ${
179-
this.compileQuery(finalQuery).sql
180-
}\nOriginal query:\n${this.compileQuery(query).sql}`
181-
);
182-
throw err;
183-
}
166+
return this.driver.txConnection
167+
? super
168+
.withConnectionProvider(
169+
new SingleConnectionProvider(this.driver.txConnection)
170+
)
171+
.executeQuery<any>(compiled, queryId)
172+
: super.executeQuery<any>(compiled, queryId);
184173
}
185174

186175
private isMutationNode(queryNode: RootOperationNode) {

packages/runtime/vitest.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { defineConfig, mergeConfig } from 'vitest/config';
22
import base from '../../vitest.base.config';
3+
import path from 'node:path';
34

45
export default mergeConfig(
56
base,
67
defineConfig({
78
test: {
8-
setupFiles: ['./test/vitest-ext.ts'],
9+
setupFiles: [path.resolve(__dirname, './test/vitest-ext.ts')],
910
},
1011
})
1112
);

0 commit comments

Comments
 (0)