cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
generated-e2be739c44

Branches

Tags

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

Clone

HTTPS

Download ZIP

tests/api-resources/acm/total-tls.test.ts

53lines · 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 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 totalTLS', () => {
13 // skipped: tests are disabled for the time being
14 test.skip('create: only required params', async () => {
15 const responsePromise = cloudflare.acm.totalTLS.create({
16 zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
17 enabled: true,
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('create: required and optional params', async () => {
30 const response = await cloudflare.acm.totalTLS.create({
31 zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
32 enabled: true,
33 certificate_authority: 'google',
34 });
35 });
36
37 // skipped: tests are disabled for the time being
38 test.skip('get: only required params', async () => {
39 const responsePromise = cloudflare.acm.totalTLS.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
40 const rawResponse = await responsePromise.asResponse();
41 expect(rawResponse).toBeInstanceOf(Response);
42 const response = await responsePromise;
43 expect(response).not.toBeInstanceOf(Response);
44 const dataAndResponse = await responsePromise.withResponse();
45 expect(dataAndResponse.data).toBe(response);
46 expect(dataAndResponse.response).toBe(rawResponse);
47 });
48
49 // skipped: tests are disabled for the time being
50 test.skip('get: required and optional params', async () => {
51 const response = await cloudflare.acm.totalTLS.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
52 });
53});
54