Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tests): unskip multipart form data tests #275

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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