Skip to content

Commit

Permalink
feat(tests): unskip multipart form data tests (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Sep 1, 2023
1 parent 6534e36 commit 47d3e18
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
6 changes: 2 additions & 4 deletions tests/api-resources/audio/transcriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Response } from 'node-fetch';
const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });

describe('resource transcriptions', () => {
// Prism doesn't support multipart/form-data
test.skip('create: only required params', async () => {
test('create: only required params', async () => {
const responsePromise = openai.audio.transcriptions.create({
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'whisper-1',
Expand All @@ -21,8 +20,7 @@ describe('resource transcriptions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism doesn't support multipart/form-data
test.skip('create: required and optional params', async () => {
test('create: required and optional params', async () => {
const response = await openai.audio.transcriptions.create({
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'whisper-1',
Expand Down
6 changes: 2 additions & 4 deletions tests/api-resources/audio/translations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Response } from 'node-fetch';
const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });

describe('resource translations', () => {
// Prism doesn't support multipart/form-data
test.skip('create: only required params', async () => {
test('create: only required params', async () => {
const responsePromise = openai.audio.translations.create({
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'whisper-1',
Expand All @@ -21,8 +20,7 @@ describe('resource translations', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism doesn't support multipart/form-data
test.skip('create: required and optional params', async () => {
test('create: required and optional params', async () => {
const response = await openai.audio.translations.create({
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'whisper-1',
Expand Down
18 changes: 6 additions & 12 deletions tests/api-resources/images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Response } from 'node-fetch';
const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });

describe('resource images', () => {
// Prism doesn't support multipart/form-data
test.skip('createVariation: only required params', async () => {
test('createVariation: only required params', async () => {
const responsePromise = openai.images.createVariation({
image: await toFile(Buffer.from('# my file contents'), 'README.md'),
});
Expand All @@ -20,8 +19,7 @@ describe('resource images', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism doesn't support multipart/form-data
test.skip('createVariation: required and optional params', async () => {
test('createVariation: required and optional params', async () => {
const response = await openai.images.createVariation({
image: await toFile(Buffer.from('# my file contents'), 'README.md'),
n: 1,
Expand All @@ -31,8 +29,7 @@ describe('resource images', () => {
});
});

// Prism doesn't support multipart/form-data
test.skip('edit: only required params', async () => {
test('edit: only required params', async () => {
const responsePromise = openai.images.edit({
image: await toFile(Buffer.from('# my file contents'), 'README.md'),
prompt: 'A cute baby sea otter wearing a beret',
Expand All @@ -46,8 +43,7 @@ describe('resource images', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism doesn't support multipart/form-data
test.skip('edit: required and optional params', async () => {
test('edit: required and optional params', async () => {
const response = await openai.images.edit({
image: await toFile(Buffer.from('# my file contents'), 'README.md'),
prompt: 'A cute baby sea otter wearing a beret',
Expand All @@ -59,8 +55,7 @@ describe('resource images', () => {
});
});

// Prism doesn't support multipart/form-data
test.skip('generate: only required params', async () => {
test('generate: only required params', async () => {
const responsePromise = openai.images.generate({ prompt: 'A cute baby sea otter' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -71,8 +66,7 @@ describe('resource images', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism doesn't support multipart/form-data
test.skip('generate: required and optional params', async () => {
test('generate: required and optional params', async () => {
const response = await openai.images.generate({
prompt: 'A cute baby sea otter',
n: 1,
Expand Down

0 comments on commit 47d3e18

Please sign in to comment.