file.test.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2. import Opencode from '@opencode-ai/sdk';
  3. const client = new Opencode({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' });
  4. describe('resource file', () => {
  5. // skipped: tests are disabled for the time being
  6. test.skip('read: only required params', async () => {
  7. const responsePromise = client.file.read({ path: 'path' });
  8. const rawResponse = await responsePromise.asResponse();
  9. expect(rawResponse).toBeInstanceOf(Response);
  10. const response = await responsePromise;
  11. expect(response).not.toBeInstanceOf(Response);
  12. const dataAndResponse = await responsePromise.withResponse();
  13. expect(dataAndResponse.data).toBe(response);
  14. expect(dataAndResponse.response).toBe(rawResponse);
  15. });
  16. // skipped: tests are disabled for the time being
  17. test.skip('read: required and optional params', async () => {
  18. const response = await client.file.read({ path: 'path' });
  19. });
  20. // skipped: tests are disabled for the time being
  21. test.skip('status', async () => {
  22. const responsePromise = client.file.status();
  23. const rawResponse = await responsePromise.asResponse();
  24. expect(rawResponse).toBeInstanceOf(Response);
  25. const response = await responsePromise;
  26. expect(response).not.toBeInstanceOf(Response);
  27. const dataAndResponse = await responsePromise.withResponse();
  28. expect(dataAndResponse.data).toBe(response);
  29. expect(dataAndResponse.response).toBe(rawResponse);
  30. });
  31. });