Skip to content

Commit b5ae452

Browse files
chore: update mock server docs
1 parent f64241c commit b5ae452

19 files changed

+104
-110
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ $ pnpm link -—global morphik
6565

6666
## Running tests
6767

68-
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
69-
70-
```sh
71-
$ npx prism mock path/to/your/openapi.yml
72-
```
73-
7468
```sh
7569
$ yarn run test
7670
```

tests/api-resources/api-keys.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = new Morphik({
88
});
99

1010
describe('resource apiKeys', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('create: only required params', async () => {
1313
const responsePromise = client.apiKeys.create({ api_key: 'api_key', provider: 'provider' });
1414
const rawResponse = await responsePromise.asResponse();
@@ -20,7 +20,7 @@ describe('resource apiKeys', () => {
2020
expect(dataAndResponse.response).toBe(rawResponse);
2121
});
2222

23-
// Prism tests are disabled
23+
// Mock server tests are disabled
2424
test.skip('create: required and optional params', async () => {
2525
const response = await client.apiKeys.create({
2626
api_key: 'api_key',
@@ -29,7 +29,7 @@ describe('resource apiKeys', () => {
2929
});
3030
});
3131

32-
// Prism tests are disabled
32+
// Mock server tests are disabled
3333
test.skip('list', async () => {
3434
const responsePromise = client.apiKeys.list();
3535
const rawResponse = await responsePromise.asResponse();

tests/api-resources/batch.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = new Morphik({
88
});
99

1010
describe('resource batch', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('retrieveChunks', async () => {
1313
const responsePromise = client.batch.retrieveChunks({});
1414
const rawResponse = await responsePromise.asResponse();
@@ -20,7 +20,7 @@ describe('resource batch', () => {
2020
expect(dataAndResponse.response).toBe(rawResponse);
2121
});
2222

23-
// Prism tests are disabled
23+
// Mock server tests are disabled
2424
test.skip('retrieveDocuments', async () => {
2525
const responsePromise = client.batch.retrieveDocuments({});
2626
const rawResponse = await responsePromise.asResponse();

tests/api-resources/chat.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = new Morphik({
88
});
99

1010
describe('resource chat', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('list', async () => {
1313
const responsePromise = client.chat.list();
1414
const rawResponse = await responsePromise.asResponse();
@@ -20,15 +20,15 @@ describe('resource chat', () => {
2020
expect(dataAndResponse.response).toBe(rawResponse);
2121
});
2222

23-
// Prism tests are disabled
23+
// Mock server tests are disabled
2424
test.skip('list: request options and params are passed correctly', async () => {
2525
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2626
await expect(client.chat.list({ limit: 1 }, { path: '/_stainless_unknown_path' })).rejects.toThrow(
2727
Morphik.NotFoundError,
2828
);
2929
});
3030

31-
// Prism tests are disabled
31+
// Mock server tests are disabled
3232
test.skip('retrieveHistory', async () => {
3333
const responsePromise = client.chat.retrieveHistory('chat_id');
3434
const rawResponse = await responsePromise.asResponse();
@@ -40,7 +40,7 @@ describe('resource chat', () => {
4040
expect(dataAndResponse.response).toBe(rawResponse);
4141
});
4242

43-
// Prism tests are disabled
43+
// Mock server tests are disabled
4444
test.skip('updateTitle: only required params', async () => {
4545
const responsePromise = client.chat.updateTitle('chat_id', { title: 'title' });
4646
const rawResponse = await responsePromise.asResponse();
@@ -52,7 +52,7 @@ describe('resource chat', () => {
5252
expect(dataAndResponse.response).toBe(rawResponse);
5353
});
5454

55-
// Prism tests are disabled
55+
// Mock server tests are disabled
5656
test.skip('updateTitle: required and optional params', async () => {
5757
const response = await client.chat.updateTitle('chat_id', { title: 'title' });
5858
});

tests/api-resources/cloud.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = new Morphik({
88
});
99

1010
describe('resource cloud', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('deleteApp: only required params', async () => {
1313
const responsePromise = client.cloud.deleteApp({ app_name: 'app_name' });
1414
const rawResponse = await responsePromise.asResponse();
@@ -20,15 +20,15 @@ describe('resource cloud', () => {
2020
expect(dataAndResponse.response).toBe(rawResponse);
2121
});
2222

23-
// Prism tests are disabled
23+
// Mock server tests are disabled
2424
test.skip('deleteApp: required and optional params', async () => {
2525
const response = await client.cloud.deleteApp({
2626
app_name: 'app_name',
2727
'X-Morphik-Admin-Secret': 'X-Morphik-Admin-Secret',
2828
});
2929
});
3030

31-
// Prism tests are disabled
31+
// Mock server tests are disabled
3232
test.skip('generateUri: only required params', async () => {
3333
const responsePromise = client.cloud.generateUri({ name: 'name' });
3434
const rawResponse = await responsePromise.asResponse();
@@ -40,7 +40,7 @@ describe('resource cloud', () => {
4040
expect(dataAndResponse.response).toBe(rawResponse);
4141
});
4242

43-
// Prism tests are disabled
43+
// Mock server tests are disabled
4444
test.skip('generateUri: required and optional params', async () => {
4545
const response = await client.cloud.generateUri({
4646
name: 'name',
@@ -53,7 +53,7 @@ describe('resource cloud', () => {
5353
});
5454
});
5555

56-
// Prism tests are disabled
56+
// Mock server tests are disabled
5757
test.skip('listApps', async () => {
5858
const responsePromise = client.cloud.listApps();
5959
const rawResponse = await responsePromise.asResponse();
@@ -65,7 +65,7 @@ describe('resource cloud', () => {
6565
expect(dataAndResponse.response).toBe(rawResponse);
6666
});
6767

68-
// Prism tests are disabled
68+
// Mock server tests are disabled
6969
test.skip('listApps: request options and params are passed correctly', async () => {
7070
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
7171
await expect(
@@ -84,7 +84,7 @@ describe('resource cloud', () => {
8484
).rejects.toThrow(Morphik.NotFoundError);
8585
});
8686

87-
// Prism tests are disabled
87+
// Mock server tests are disabled
8888
test.skip('renameApp: only required params', async () => {
8989
const responsePromise = client.cloud.renameApp({ new_name: 'new_name' });
9090
const rawResponse = await responsePromise.asResponse();
@@ -96,7 +96,7 @@ describe('resource cloud', () => {
9696
expect(dataAndResponse.response).toBe(rawResponse);
9797
});
9898

99-
// Prism tests are disabled
99+
// Mock server tests are disabled
100100
test.skip('renameApp: required and optional params', async () => {
101101
const response = await client.cloud.renameApp({
102102
new_name: 'new_name',
@@ -106,7 +106,7 @@ describe('resource cloud', () => {
106106
});
107107
});
108108

109-
// Prism tests are disabled
109+
// Mock server tests are disabled
110110
test.skip('rotateAppToken', async () => {
111111
const responsePromise = client.cloud.rotateAppToken();
112112
const rawResponse = await responsePromise.asResponse();
@@ -118,7 +118,7 @@ describe('resource cloud', () => {
118118
expect(dataAndResponse.response).toBe(rawResponse);
119119
});
120120

121-
// Prism tests are disabled
121+
// Mock server tests are disabled
122122
test.skip('rotateAppToken: request options and params are passed correctly', async () => {
123123
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
124124
await expect(

tests/api-resources/documents.test.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = new Morphik({
88
});
99

1010
describe('resource documents', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('retrieve', async () => {
1313
const responsePromise = client.documents.retrieve('document_id');
1414
const rawResponse = await responsePromise.asResponse();
@@ -20,7 +20,7 @@ describe('resource documents', () => {
2020
expect(dataAndResponse.response).toBe(rawResponse);
2121
});
2222

23-
// Prism tests are disabled
23+
// Mock server tests are disabled
2424
test.skip('list', async () => {
2525
const responsePromise = client.documents.list({});
2626
const rawResponse = await responsePromise.asResponse();
@@ -32,7 +32,7 @@ describe('resource documents', () => {
3232
expect(dataAndResponse.response).toBe(rawResponse);
3333
});
3434

35-
// Prism tests are disabled
35+
// Mock server tests are disabled
3636
test.skip('delete', async () => {
3737
const responsePromise = client.documents.delete('document_id');
3838
const rawResponse = await responsePromise.asResponse();
@@ -44,7 +44,7 @@ describe('resource documents', () => {
4444
expect(dataAndResponse.response).toBe(rawResponse);
4545
});
4646

47-
// Prism tests are disabled
47+
// Mock server tests are disabled
4848
test.skip('downloadFile', async () => {
4949
const responsePromise = client.documents.downloadFile('document_id');
5050
const rawResponse = await responsePromise.asResponse();
@@ -56,7 +56,7 @@ describe('resource documents', () => {
5656
expect(dataAndResponse.response).toBe(rawResponse);
5757
});
5858

59-
// Prism tests are disabled
59+
// Mock server tests are disabled
6060
test.skip('getByFilename', async () => {
6161
const responsePromise = client.documents.getByFilename('filename');
6262
const rawResponse = await responsePromise.asResponse();
@@ -68,7 +68,7 @@ describe('resource documents', () => {
6868
expect(dataAndResponse.response).toBe(rawResponse);
6969
});
7070

71-
// Prism tests are disabled
71+
// Mock server tests are disabled
7272
test.skip('getByFilename: request options and params are passed correctly', async () => {
7373
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
7474
await expect(
@@ -84,7 +84,7 @@ describe('resource documents', () => {
8484
).rejects.toThrow(Morphik.NotFoundError);
8585
});
8686

87-
// Prism tests are disabled
87+
// Mock server tests are disabled
8888
test.skip('getDownloadURL', async () => {
8989
const responsePromise = client.documents.getDownloadURL('document_id');
9090
const rawResponse = await responsePromise.asResponse();
@@ -96,15 +96,15 @@ describe('resource documents', () => {
9696
expect(dataAndResponse.response).toBe(rawResponse);
9797
});
9898

99-
// Prism tests are disabled
99+
// Mock server tests are disabled
100100
test.skip('getDownloadURL: request options and params are passed correctly', async () => {
101101
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
102102
await expect(
103103
client.documents.getDownloadURL('document_id', { expires_in: 0 }, { path: '/_stainless_unknown_path' }),
104104
).rejects.toThrow(Morphik.NotFoundError);
105105
});
106106

107-
// Prism tests are disabled
107+
// Mock server tests are disabled
108108
test.skip('getStatus', async () => {
109109
const responsePromise = client.documents.getStatus('document_id');
110110
const rawResponse = await responsePromise.asResponse();
@@ -116,7 +116,7 @@ describe('resource documents', () => {
116116
expect(dataAndResponse.response).toBe(rawResponse);
117117
});
118118

119-
// Prism tests are disabled
119+
// Mock server tests are disabled
120120
test.skip('getSummary', async () => {
121121
const responsePromise = client.documents.getSummary('document_id');
122122
const rawResponse = await responsePromise.asResponse();
@@ -128,7 +128,7 @@ describe('resource documents', () => {
128128
expect(dataAndResponse.response).toBe(rawResponse);
129129
});
130130

131-
// Prism tests are disabled
131+
// Mock server tests are disabled
132132
test.skip('listDocs', async () => {
133133
const responsePromise = client.documents.listDocs({});
134134
const rawResponse = await responsePromise.asResponse();
@@ -140,7 +140,7 @@ describe('resource documents', () => {
140140
expect(dataAndResponse.response).toBe(rawResponse);
141141
});
142142

143-
// Prism tests are disabled
143+
// Mock server tests are disabled
144144
test.skip('pages: only required params', async () => {
145145
const responsePromise = client.documents.pages({
146146
document_id: 'document_id',
@@ -156,7 +156,7 @@ describe('resource documents', () => {
156156
expect(dataAndResponse.response).toBe(rawResponse);
157157
});
158158

159-
// Prism tests are disabled
159+
// Mock server tests are disabled
160160
test.skip('pages: required and optional params', async () => {
161161
const response = await client.documents.pages({
162162
document_id: 'document_id',
@@ -166,7 +166,7 @@ describe('resource documents', () => {
166166
});
167167
});
168168

169-
// Prism tests are disabled
169+
// Mock server tests are disabled
170170
test.skip('updateFile: only required params', async () => {
171171
const responsePromise = client.documents.updateFile('document_id', {
172172
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
@@ -180,7 +180,7 @@ describe('resource documents', () => {
180180
expect(dataAndResponse.response).toBe(rawResponse);
181181
});
182182

183-
// Prism tests are disabled
183+
// Mock server tests are disabled
184184
test.skip('updateFile: required and optional params', async () => {
185185
const response = await client.documents.updateFile('document_id', {
186186
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
@@ -190,7 +190,7 @@ describe('resource documents', () => {
190190
});
191191
});
192192

193-
// Prism tests are disabled
193+
// Mock server tests are disabled
194194
test.skip('updateMetadata', async () => {
195195
const responsePromise = client.documents.updateMetadata('document_id', {});
196196
const rawResponse = await responsePromise.asResponse();
@@ -202,7 +202,7 @@ describe('resource documents', () => {
202202
expect(dataAndResponse.response).toBe(rawResponse);
203203
});
204204

205-
// Prism tests are disabled
205+
// Mock server tests are disabled
206206
test.skip('updateText: only required params', async () => {
207207
const responsePromise = client.documents.updateText('document_id', { content: 'content' });
208208
const rawResponse = await responsePromise.asResponse();
@@ -214,7 +214,7 @@ describe('resource documents', () => {
214214
expect(dataAndResponse.response).toBe(rawResponse);
215215
});
216216

217-
// Prism tests are disabled
217+
// Mock server tests are disabled
218218
test.skip('updateText: required and optional params', async () => {
219219
const response = await client.documents.updateText('document_id', {
220220
content: 'content',
@@ -227,7 +227,7 @@ describe('resource documents', () => {
227227
});
228228
});
229229

230-
// Prism tests are disabled
230+
// Mock server tests are disabled
231231
test.skip('upsertSummary: only required params', async () => {
232232
const responsePromise = client.documents.upsertSummary('document_id', { content: 'content' });
233233
const rawResponse = await responsePromise.asResponse();
@@ -239,7 +239,7 @@ describe('resource documents', () => {
239239
expect(dataAndResponse.response).toBe(rawResponse);
240240
});
241241

242-
// Prism tests are disabled
242+
// Mock server tests are disabled
243243
test.skip('upsertSummary: required and optional params', async () => {
244244
const response = await client.documents.upsertSummary('document_id', {
245245
content: 'content',

0 commit comments

Comments
 (0)