mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(Google BigQuery Node): Send timeoutMs in query, pagination support (#10205)
This commit is contained in:
@@ -10,7 +10,7 @@ jest.mock('../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
googleApiRequest: jest.fn(async (method: IHttpRequestMethods, resource: string) => {
|
||||
googleBigQueryApiRequest: jest.fn(async (method: IHttpRequestMethods, resource: string) => {
|
||||
if (resource === '/v2/projects/test-project/jobs' && method === 'POST') {
|
||||
return {
|
||||
jobReference: {
|
||||
@@ -25,7 +25,7 @@ jest.mock('../../../v2/transport', () => {
|
||||
return {};
|
||||
}
|
||||
}),
|
||||
// googleApiRequestAllItems: jest.fn(async () => {}),
|
||||
googleBigQueryApiRequestAllItems: jest.fn(async () => ({ rows: [], schema: {} })),
|
||||
};
|
||||
});
|
||||
|
||||
@@ -47,8 +47,9 @@ describe('Test Google BigQuery V2, executeQuery', () => {
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
const { result } = await executeWorkflow(testData, types);
|
||||
|
||||
expect(transport.googleApiRequest).toHaveBeenCalledTimes(2);
|
||||
expect(transport.googleApiRequest).toHaveBeenCalledWith(
|
||||
expect(transport.googleBigQueryApiRequest).toHaveBeenCalledTimes(1);
|
||||
expect(transport.googleBigQueryApiRequestAllItems).toHaveBeenCalledTimes(1);
|
||||
expect(transport.googleBigQueryApiRequest).toHaveBeenCalledWith(
|
||||
'POST',
|
||||
'/v2/projects/test-project/jobs',
|
||||
{
|
||||
@@ -60,11 +61,11 @@ describe('Test Google BigQuery V2, executeQuery', () => {
|
||||
},
|
||||
},
|
||||
);
|
||||
expect(transport.googleApiRequest).toHaveBeenCalledWith(
|
||||
expect(transport.googleBigQueryApiRequestAllItems).toHaveBeenCalledWith(
|
||||
'GET',
|
||||
'/v2/projects/test-project/queries/job_123',
|
||||
undefined,
|
||||
{},
|
||||
{ location: undefined, maxResults: 1000, timeoutMs: 10000 },
|
||||
);
|
||||
|
||||
expect(result.finished).toEqual(true);
|
||||
|
||||
Reference in New Issue
Block a user