Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
|
import nock from 'nock';
|
|
|
|
jest.mock('jsonwebtoken', () => ({
|
|
sign: jest.fn().mockReturnValue('signature'),
|
|
}));
|
|
|
|
describe('Test Google BigQuery V2, executeQuery', () => {
|
|
nock('https://oauth2.googleapis.com')
|
|
.persist()
|
|
.post(
|
|
'/token',
|
|
'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=signature',
|
|
)
|
|
.reply(200, { access_token: 'token' });
|
|
|
|
nock('https://bigquery.googleapis.com/bigquery')
|
|
.post('/v2/projects/test-project/jobs', {
|
|
configuration: {
|
|
query: {
|
|
query: 'SELECT * FROM bigquery_node_dev_test_dataset.test_json;',
|
|
useLegacySql: false,
|
|
},
|
|
},
|
|
})
|
|
.reply(200, {
|
|
jobReference: {
|
|
jobId: 'job_123',
|
|
},
|
|
status: {
|
|
state: 'RUNNING',
|
|
},
|
|
})
|
|
.get('/v2/projects/test-project/queries/job_123?maxResults=1000&timeoutMs=10000')
|
|
.replyWithError('Internal server error');
|
|
|
|
new NodeTestHarness().setupTests({
|
|
workflowFiles: ['executeQueryContinueOnJobFail.workflow.json'],
|
|
});
|
|
});
|