Skip to content

Commit 1c1ae0f

Browse files
chore: update mock server docs
1 parent 5784a3f commit 1c1ae0f

19 files changed

+149
-155
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 @onkernel/sdk
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/apps.test.ts

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

1010
describe('resource apps', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('list', async () => {
1313
const responsePromise = client.apps.list();
1414
const rawResponse = await responsePromise.asResponse();
@@ -20,7 +20,7 @@ describe('resource apps', () => {
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(

tests/api-resources/auth/connections.test.ts

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

1010
describe('resource connections', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('create: only required params', async () => {
1313
const responsePromise = client.auth.connections.create({
1414
domain: 'netflix.com',
@@ -23,7 +23,7 @@ describe('resource connections', () => {
2323
expect(dataAndResponse.response).toBe(rawResponse);
2424
});
2525

26-
// Prism tests are disabled
26+
// Mock server tests are disabled
2727
test.skip('create: required and optional params', async () => {
2828
const response = await client.auth.connections.create({
2929
domain: 'netflix.com',
@@ -42,7 +42,7 @@ describe('resource connections', () => {
4242
});
4343
});
4444

45-
// Prism tests are disabled
45+
// Mock server tests are disabled
4646
test.skip('retrieve', async () => {
4747
const responsePromise = client.auth.connections.retrieve('id');
4848
const rawResponse = await responsePromise.asResponse();
@@ -54,7 +54,7 @@ describe('resource connections', () => {
5454
expect(dataAndResponse.response).toBe(rawResponse);
5555
});
5656

57-
// Prism tests are disabled
57+
// Mock server tests are disabled
5858
test.skip('list', async () => {
5959
const responsePromise = client.auth.connections.list();
6060
const rawResponse = await responsePromise.asResponse();
@@ -66,7 +66,7 @@ describe('resource connections', () => {
6666
expect(dataAndResponse.response).toBe(rawResponse);
6767
});
6868

69-
// Prism tests are disabled
69+
// Mock server tests are disabled
7070
test.skip('list: request options and params are passed correctly', async () => {
7171
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
7272
await expect(
@@ -82,7 +82,7 @@ describe('resource connections', () => {
8282
).rejects.toThrow(Kernel.NotFoundError);
8383
});
8484

85-
// Prism tests are disabled
85+
// Mock server tests are disabled
8686
test.skip('delete', async () => {
8787
const responsePromise = client.auth.connections.delete('id');
8888
const rawResponse = await responsePromise.asResponse();
@@ -94,7 +94,7 @@ describe('resource connections', () => {
9494
expect(dataAndResponse.response).toBe(rawResponse);
9595
});
9696

97-
// Prism doesn't support text/event-stream responses
97+
// Mock server doesn't support text/event-stream responses
9898
test.skip('follow', async () => {
9999
const responsePromise = client.auth.connections.follow('id');
100100
const rawResponse = await responsePromise.asResponse();
@@ -106,7 +106,7 @@ describe('resource connections', () => {
106106
expect(dataAndResponse.response).toBe(rawResponse);
107107
});
108108

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

121-
// Prism tests are disabled
121+
// Mock server tests are disabled
122122
test.skip('login: 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(
@@ -130,7 +130,7 @@ describe('resource connections', () => {
130130
).rejects.toThrow(Kernel.NotFoundError);
131131
});
132132

133-
// Prism tests are disabled
133+
// Mock server tests are disabled
134134
test.skip('submit', async () => {
135135
const responsePromise = client.auth.connections.submit('id', {});
136136
const rawResponse = await responsePromise.asResponse();

tests/api-resources/browser-pools.test.ts

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

1010
describe('resource browserPools', () => {
11-
// Prism tests are disabled
11+
// Mock server tests are disabled
1212
test.skip('create: only required params', async () => {
1313
const responsePromise = client.browserPools.create({ size: 10 });
1414
const rawResponse = await responsePromise.asResponse();
@@ -20,7 +20,7 @@ describe('resource browserPools', () => {
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.browserPools.create({
2626
size: 10,
@@ -45,7 +45,7 @@ describe('resource browserPools', () => {
4545
});
4646
});
4747

48-
// Prism tests are disabled
48+
// Mock server tests are disabled
4949
test.skip('retrieve', async () => {
5050
const responsePromise = client.browserPools.retrieve('id_or_name');
5151
const rawResponse = await responsePromise.asResponse();
@@ -57,7 +57,7 @@ describe('resource browserPools', () => {
5757
expect(dataAndResponse.response).toBe(rawResponse);
5858
});
5959

60-
// Prism tests are disabled
60+
// Mock server tests are disabled
6161
test.skip('update: only required params', async () => {
6262
const responsePromise = client.browserPools.update('id_or_name', { size: 10 });
6363
const rawResponse = await responsePromise.asResponse();
@@ -69,7 +69,7 @@ describe('resource browserPools', () => {
6969
expect(dataAndResponse.response).toBe(rawResponse);
7070
});
7171

72-
// Prism tests are disabled
72+
// Mock server tests are disabled
7373
test.skip('update: required and optional params', async () => {
7474
const response = await client.browserPools.update('id_or_name', {
7575
size: 10,
@@ -95,7 +95,7 @@ describe('resource browserPools', () => {
9595
});
9696
});
9797

98-
// Prism tests are disabled
98+
// Mock server tests are disabled
9999
test.skip('list', async () => {
100100
const responsePromise = client.browserPools.list();
101101
const rawResponse = await responsePromise.asResponse();
@@ -107,7 +107,7 @@ describe('resource browserPools', () => {
107107
expect(dataAndResponse.response).toBe(rawResponse);
108108
});
109109

110-
// Prism tests are disabled
110+
// Mock server tests are disabled
111111
test.skip('delete', async () => {
112112
const responsePromise = client.browserPools.delete('id_or_name');
113113
const rawResponse = await responsePromise.asResponse();
@@ -119,15 +119,15 @@ describe('resource browserPools', () => {
119119
expect(dataAndResponse.response).toBe(rawResponse);
120120
});
121121

122-
// Prism tests are disabled
122+
// Mock server tests are disabled
123123
test.skip('delete: request options and params are passed correctly', async () => {
124124
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
125125
await expect(
126126
client.browserPools.delete('id_or_name', { force: true }, { path: '/_stainless_unknown_path' }),
127127
).rejects.toThrow(Kernel.NotFoundError);
128128
});
129129

130-
// Prism tests are disabled
130+
// Mock server tests are disabled
131131
test.skip('acquire', async () => {
132132
const responsePromise = client.browserPools.acquire('id_or_name', {});
133133
const rawResponse = await responsePromise.asResponse();
@@ -139,7 +139,7 @@ describe('resource browserPools', () => {
139139
expect(dataAndResponse.response).toBe(rawResponse);
140140
});
141141

142-
// Prism tests are disabled
142+
// Mock server tests are disabled
143143
test.skip('flush', async () => {
144144
const responsePromise = client.browserPools.flush('id_or_name');
145145
const rawResponse = await responsePromise.asResponse();
@@ -151,7 +151,7 @@ describe('resource browserPools', () => {
151151
expect(dataAndResponse.response).toBe(rawResponse);
152152
});
153153

154-
// Prism tests are disabled
154+
// Mock server tests are disabled
155155
test.skip('release: only required params', async () => {
156156
const responsePromise = client.browserPools.release('id_or_name', {
157157
session_id: 'ts8iy3sg25ibheguyni2lg9t',
@@ -165,7 +165,7 @@ describe('resource browserPools', () => {
165165
expect(dataAndResponse.response).toBe(rawResponse);
166166
});
167167

168-
// Prism tests are disabled
168+
// Mock server tests are disabled
169169
test.skip('release: required and optional params', async () => {
170170
const response = await client.browserPools.release('id_or_name', {
171171
session_id: 'ts8iy3sg25ibheguyni2lg9t',

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

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

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

23-
// Prism tests are disabled
23+
// Mock server tests are disabled
2424
test.skip('create: 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(
@@ -51,7 +51,7 @@ describe('resource browsers', () => {
5151
).rejects.toThrow(Kernel.NotFoundError);
5252
});
5353

54-
// Prism tests are disabled
54+
// Mock server tests are disabled
5555
test.skip('retrieve', async () => {
5656
const responsePromise = client.browsers.retrieve('htzv5orfit78e1m2biiifpbv');
5757
const rawResponse = await responsePromise.asResponse();
@@ -63,7 +63,7 @@ describe('resource browsers', () => {
6363
expect(dataAndResponse.response).toBe(rawResponse);
6464
});
6565

66-
// Prism tests are disabled
66+
// Mock server tests are disabled
6767
test.skip('retrieve: request options and params are passed correctly', async () => {
6868
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
6969
await expect(
@@ -75,7 +75,7 @@ describe('resource browsers', () => {
7575
).rejects.toThrow(Kernel.NotFoundError);
7676
});
7777

78-
// Prism tests are disabled
78+
// Mock server tests are disabled
7979
test.skip('update', async () => {
8080
const responsePromise = client.browsers.update('htzv5orfit78e1m2biiifpbv', {});
8181
const rawResponse = await responsePromise.asResponse();
@@ -87,7 +87,7 @@ describe('resource browsers', () => {
8787
expect(dataAndResponse.response).toBe(rawResponse);
8888
});
8989

90-
// Prism tests are disabled
90+
// Mock server tests are disabled
9191
test.skip('list', async () => {
9292
const responsePromise = client.browsers.list();
9393
const rawResponse = await responsePromise.asResponse();
@@ -99,7 +99,7 @@ describe('resource browsers', () => {
9999
expect(dataAndResponse.response).toBe(rawResponse);
100100
});
101101

102-
// Prism tests are disabled
102+
// Mock server tests are disabled
103103
test.skip('list: request options and params are passed correctly', async () => {
104104
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
105105
await expect(
@@ -115,7 +115,7 @@ describe('resource browsers', () => {
115115
).rejects.toThrow(Kernel.NotFoundError);
116116
});
117117

118-
// Prism tests are disabled
118+
// Mock server tests are disabled
119119
test.skip('delete: only required params', async () => {
120120
const responsePromise = client.browsers.delete({ persistent_id: 'persistent_id' });
121121
const rawResponse = await responsePromise.asResponse();
@@ -127,12 +127,12 @@ describe('resource browsers', () => {
127127
expect(dataAndResponse.response).toBe(rawResponse);
128128
});
129129

130-
// Prism tests are disabled
130+
// Mock server tests are disabled
131131
test.skip('delete: required and optional params', async () => {
132132
const response = await client.browsers.delete({ persistent_id: 'persistent_id' });
133133
});
134134

135-
// Prism tests are disabled
135+
// Mock server tests are disabled
136136
test.skip('deleteByID', async () => {
137137
const responsePromise = client.browsers.deleteByID('htzv5orfit78e1m2biiifpbv');
138138
const rawResponse = await responsePromise.asResponse();
@@ -144,7 +144,7 @@ describe('resource browsers', () => {
144144
expect(dataAndResponse.response).toBe(rawResponse);
145145
});
146146

147-
// Prism tests are disabled
147+
// Mock server tests are disabled
148148
test.skip('loadExtensions: only required params', async () => {
149149
const responsePromise = client.browsers.loadExtensions('id', {
150150
extensions: [{ name: 'name', zip_file: await toFile(Buffer.from('# my file contents'), 'README.md') }],
@@ -158,7 +158,7 @@ describe('resource browsers', () => {
158158
expect(dataAndResponse.response).toBe(rawResponse);
159159
});
160160

161-
// Prism tests are disabled
161+
// Mock server tests are disabled
162162
test.skip('loadExtensions: required and optional params', async () => {
163163
const response = await client.browsers.loadExtensions('id', {
164164
extensions: [{ name: 'name', zip_file: await toFile(Buffer.from('# my file contents'), 'README.md') }],

0 commit comments

Comments
 (0)