cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.3.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

tests/api-resources/addressing/loa-documents.test.ts

42lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import Cloudflare from 'cloudflare';
4import { Response } from 'node-fetch';
5
6const client = 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 loaDocuments', () => {
13 // TODO: investigate broken test
14 test.skip('create: only required params', async () => {
15 const responsePromise = client.addressing.loaDocuments.create({
16 account_id: '258def64c72dae45f3e4c8516e2111f2',
17 loa_document: '@document.pdf',
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 // TODO: investigate broken test
29 test.skip('create: required and optional params', async () => {
30 const response = await client.addressing.loaDocuments.create({
31 account_id: '258def64c72dae45f3e4c8516e2111f2',
32 loa_document: '@document.pdf',
33 });
34 });
35
36 // TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489
37 test.skip('get: required and optional params', async () => {
38 const response = await client.addressing.loaDocuments.get('d933b1530bc56c9953cf8ce166da8004', {
39 account_id: '258def64c72dae45f3e4c8516e2111f2',
40 });
41 });
42});
43