cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
generated-e3e8a04412

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

tests/api-resources/argo/smart-routing.test.ts

52lines · modecode

1// File generated from our OpenAPI spec by Stainless.
2
3import Cloudflare from 'cloudflare';
4import { Response } from 'node-fetch';
5
6const cloudflare = new Cloudflare({
7 apiKey: '144c9defac04969c7bfad8efaa8ea194',
8 apiEmail: 'user@example.com',
9 baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
10});
11
12describe('resource smartRouting', () => {
13 // skipped: tests are disabled for the time being
14 test.skip('edit: only required params', async () => {
15 const responsePromise = cloudflare.argo.smartRouting.edit({
16 zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
17 value: 'on',
18 });
19 const rawResponse = await responsePromise.asResponse();
20 expect(rawResponse).toBeInstanceOf(Response);
21 const response = await responsePromise;
22 expect(response).not.toBeInstanceOf(Response);
23 const dataAndResponse = await responsePromise.withResponse();
24 expect(dataAndResponse.data).toBe(response);
25 expect(dataAndResponse.response).toBe(rawResponse);
26 });
27
28 // skipped: tests are disabled for the time being
29 test.skip('edit: required and optional params', async () => {
30 const response = await cloudflare.argo.smartRouting.edit({
31 zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
32 value: 'on',
33 });
34 });
35
36 // skipped: tests are disabled for the time being
37 test.skip('get: only required params', async () => {
38 const responsePromise = cloudflare.argo.smartRouting.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
39 const rawResponse = await responsePromise.asResponse();
40 expect(rawResponse).toBeInstanceOf(Response);
41 const response = await responsePromise;
42 expect(response).not.toBeInstanceOf(Response);
43 const dataAndResponse = await responsePromise.withResponse();
44 expect(dataAndResponse.data).toBe(response);
45 expect(dataAndResponse.response).toBe(rawResponse);
46 });
47
48 // skipped: tests are disabled for the time being
49 test.skip('get: required and optional params', async () => {
50 const response = await cloudflare.argo.smartRouting.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
51 });
52});
53