Skip to content

Commit 8d85111

Browse files
chore: update mock server docs
1 parent 14035d4 commit 8d85111

34 files changed

Lines changed: 180 additions & 186 deletions

CONTRIBUTING.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ $ pnpm link -—global @stainless-commons/spotify
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/albums.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const client = new Spotify({
99
});
1010

1111
describe('resource albums', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.albums.retrieve('4aawyAB9vmqN3uQ7FjRGTy');
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,7 +21,7 @@ describe('resource albums', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('retrieve: request options and params are passed correctly', async () => {
2626
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2727
await expect(
@@ -33,7 +33,7 @@ describe('resource albums', () => {
3333
).rejects.toThrow(Spotify.NotFoundError);
3434
});
3535

36-
// Prism tests are disabled
36+
// Mock server tests are disabled
3737
test.skip('bulkRetrieve: only required params', async () => {
3838
const responsePromise = client.albums.bulkRetrieve({
3939
ids: '382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc',
@@ -47,15 +47,15 @@ describe('resource albums', () => {
4747
expect(dataAndResponse.response).toBe(rawResponse);
4848
});
4949

50-
// Prism tests are disabled
50+
// Mock server tests are disabled
5151
test.skip('bulkRetrieve: required and optional params', async () => {
5252
const response = await client.albums.bulkRetrieve({
5353
ids: '382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc',
5454
market: 'ES',
5555
});
5656
});
5757

58-
// Prism tests are disabled
58+
// Mock server tests are disabled
5959
test.skip('listTracks', async () => {
6060
const responsePromise = client.albums.listTracks('4aawyAB9vmqN3uQ7FjRGTy');
6161
const rawResponse = await responsePromise.asResponse();
@@ -67,7 +67,7 @@ describe('resource albums', () => {
6767
expect(dataAndResponse.response).toBe(rawResponse);
6868
});
6969

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

tests/api-resources/artists.test.ts

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

1111
describe('resource artists', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.artists.retrieve('0TnOYISbd1XYRBk9myaseg');
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,7 +21,7 @@ describe('resource artists', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('bulkRetrieve: only required params', async () => {
2626
const responsePromise = client.artists.bulkRetrieve({
2727
ids: '2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6',
@@ -35,14 +35,14 @@ describe('resource artists', () => {
3535
expect(dataAndResponse.response).toBe(rawResponse);
3636
});
3737

38-
// Prism tests are disabled
38+
// Mock server tests are disabled
3939
test.skip('bulkRetrieve: required and optional params', async () => {
4040
const response = await client.artists.bulkRetrieve({
4141
ids: '2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6',
4242
});
4343
});
4444

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

57-
// Prism tests are disabled
57+
// Mock server tests are disabled
5858
test.skip('listAlbums: request options and params are passed correctly', async () => {
5959
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
6060
await expect(
@@ -71,7 +71,7 @@ describe('resource artists', () => {
7171
).rejects.toThrow(Spotify.NotFoundError);
7272
});
7373

74-
// Prism tests are disabled
74+
// Mock server tests are disabled
7575
test.skip('listRelatedArtists', async () => {
7676
const responsePromise = client.artists.listRelatedArtists('0TnOYISbd1XYRBk9myaseg');
7777
const rawResponse = await responsePromise.asResponse();
@@ -83,7 +83,7 @@ describe('resource artists', () => {
8383
expect(dataAndResponse.response).toBe(rawResponse);
8484
});
8585

86-
// Prism tests are disabled
86+
// Mock server tests are disabled
8787
test.skip('topTracks', async () => {
8888
const responsePromise = client.artists.topTracks('0TnOYISbd1XYRBk9myaseg');
8989
const rawResponse = await responsePromise.asResponse();
@@ -95,7 +95,7 @@ describe('resource artists', () => {
9595
expect(dataAndResponse.response).toBe(rawResponse);
9696
});
9797

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

tests/api-resources/audio-analysis.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const client = new Spotify({
99
});
1010

1111
describe('resource audioAnalysis', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.audioAnalysis.retrieve('11dFghVXANMlKmJXsNCbNl');
1515
const rawResponse = await responsePromise.asResponse();

tests/api-resources/audio-features.test.ts

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

1111
describe('resource audioFeatures', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.audioFeatures.retrieve('11dFghVXANMlKmJXsNCbNl');
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,7 +21,7 @@ describe('resource audioFeatures', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('bulkRetrieve: only required params', async () => {
2626
const responsePromise = client.audioFeatures.bulkRetrieve({
2727
ids: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B',
@@ -35,7 +35,7 @@ describe('resource audioFeatures', () => {
3535
expect(dataAndResponse.response).toBe(rawResponse);
3636
});
3737

38-
// Prism tests are disabled
38+
// Mock server tests are disabled
3939
test.skip('bulkRetrieve: required and optional params', async () => {
4040
const response = await client.audioFeatures.bulkRetrieve({
4141
ids: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B',

tests/api-resources/audiobooks.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const client = new Spotify({
99
});
1010

1111
describe('resource audiobooks', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.audiobooks.retrieve('7iHfbu1YPACw6oZPAFJtqe');
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,7 +21,7 @@ describe('resource audiobooks', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('retrieve: request options and params are passed correctly', async () => {
2626
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2727
await expect(
@@ -33,7 +33,7 @@ describe('resource audiobooks', () => {
3333
).rejects.toThrow(Spotify.NotFoundError);
3434
});
3535

36-
// Prism tests are disabled
36+
// Mock server tests are disabled
3737
test.skip('bulkRetrieve: only required params', async () => {
3838
const responsePromise = client.audiobooks.bulkRetrieve({
3939
ids: '18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe',
@@ -47,15 +47,15 @@ describe('resource audiobooks', () => {
4747
expect(dataAndResponse.response).toBe(rawResponse);
4848
});
4949

50-
// Prism tests are disabled
50+
// Mock server tests are disabled
5151
test.skip('bulkRetrieve: required and optional params', async () => {
5252
const response = await client.audiobooks.bulkRetrieve({
5353
ids: '18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe',
5454
market: 'ES',
5555
});
5656
});
5757

58-
// Prism tests are disabled
58+
// Mock server tests are disabled
5959
test.skip('listChapters', async () => {
6060
const responsePromise = client.audiobooks.listChapters('7iHfbu1YPACw6oZPAFJtqe');
6161
const rawResponse = await responsePromise.asResponse();
@@ -67,7 +67,7 @@ describe('resource audiobooks', () => {
6767
expect(dataAndResponse.response).toBe(rawResponse);
6868
});
6969

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

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const client = new Spotify({
99
});
1010

1111
describe('resource browse', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('getFeaturedPlaylists', async () => {
1414
const responsePromise = client.browse.getFeaturedPlaylists();
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,7 +21,7 @@ describe('resource browse', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('getFeaturedPlaylists: request options and params are passed correctly', async () => {
2626
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2727
await expect(
@@ -36,7 +36,7 @@ describe('resource browse', () => {
3636
).rejects.toThrow(Spotify.NotFoundError);
3737
});
3838

39-
// Prism tests are disabled
39+
// Mock server tests are disabled
4040
test.skip('getNewReleases', async () => {
4141
const responsePromise = client.browse.getNewReleases();
4242
const rawResponse = await responsePromise.asResponse();
@@ -48,7 +48,7 @@ describe('resource browse', () => {
4848
expect(dataAndResponse.response).toBe(rawResponse);
4949
});
5050

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

tests/api-resources/browse/categories.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const client = new Spotify({
99
});
1010

1111
describe('resource categories', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.browse.categories.retrieve('dinner');
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,15 +21,15 @@ describe('resource categories', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('retrieve: request options and params are passed correctly', async () => {
2626
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2727
await expect(
2828
client.browse.categories.retrieve('dinner', { locale: 'sv_SE' }, { path: '/_stainless_unknown_path' }),
2929
).rejects.toThrow(Spotify.NotFoundError);
3030
});
3131

32-
// Prism tests are disabled
32+
// Mock server tests are disabled
3333
test.skip('list', async () => {
3434
const responsePromise = client.browse.categories.list();
3535
const rawResponse = await responsePromise.asResponse();
@@ -41,7 +41,7 @@ describe('resource categories', () => {
4141
expect(dataAndResponse.response).toBe(rawResponse);
4242
});
4343

44-
// Prism tests are disabled
44+
// Mock server tests are disabled
4545
test.skip('list: request options and params are passed correctly', async () => {
4646
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
4747
await expect(
@@ -56,7 +56,7 @@ describe('resource categories', () => {
5656
).rejects.toThrow(Spotify.NotFoundError);
5757
});
5858

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

71-
// Prism tests are disabled
71+
// Mock server tests are disabled
7272
test.skip('getPlaylists: 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(

tests/api-resources/chapters.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const client = new Spotify({
99
});
1010

1111
describe('resource chapters', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.chapters.retrieve('0D5wENdkdwbqlrHoaJ9g29');
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,7 +21,7 @@ describe('resource chapters', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('retrieve: request options and params are passed correctly', async () => {
2626
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2727
await expect(
@@ -33,7 +33,7 @@ describe('resource chapters', () => {
3333
).rejects.toThrow(Spotify.NotFoundError);
3434
});
3535

36-
// Prism tests are disabled
36+
// Mock server tests are disabled
3737
test.skip('bulkRetrieve: only required params', async () => {
3838
const responsePromise = client.chapters.bulkRetrieve({
3939
ids: '0IsXVP0JmcB2adSE338GkK,3ZXb8FKZGU0EHALYX6uCzU,0D5wENdkdwbqlrHoaJ9g29',
@@ -47,7 +47,7 @@ describe('resource chapters', () => {
4747
expect(dataAndResponse.response).toBe(rawResponse);
4848
});
4949

50-
// Prism tests are disabled
50+
// Mock server tests are disabled
5151
test.skip('bulkRetrieve: required and optional params', async () => {
5252
const response = await client.chapters.bulkRetrieve({
5353
ids: '0IsXVP0JmcB2adSE338GkK,3ZXb8FKZGU0EHALYX6uCzU,0D5wENdkdwbqlrHoaJ9g29',

tests/api-resources/episodes.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const client = new Spotify({
99
});
1010

1111
describe('resource episodes', () => {
12-
// Prism tests are disabled
12+
// Mock server tests are disabled
1313
test.skip('retrieve', async () => {
1414
const responsePromise = client.episodes.retrieve('512ojhOuo1ktJprKbVcKyQ');
1515
const rawResponse = await responsePromise.asResponse();
@@ -21,7 +21,7 @@ describe('resource episodes', () => {
2121
expect(dataAndResponse.response).toBe(rawResponse);
2222
});
2323

24-
// Prism tests are disabled
24+
// Mock server tests are disabled
2525
test.skip('retrieve: request options and params are passed correctly', async () => {
2626
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2727
await expect(
@@ -33,7 +33,7 @@ describe('resource episodes', () => {
3333
).rejects.toThrow(Spotify.NotFoundError);
3434
});
3535

36-
// Prism tests are disabled
36+
// Mock server tests are disabled
3737
test.skip('bulkRetrieve: only required params', async () => {
3838
const responsePromise = client.episodes.bulkRetrieve({
3939
ids: '77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwf',
@@ -47,7 +47,7 @@ describe('resource episodes', () => {
4747
expect(dataAndResponse.response).toBe(rawResponse);
4848
});
4949

50-
// Prism tests are disabled
50+
// Mock server tests are disabled
5151
test.skip('bulkRetrieve: required and optional params', async () => {
5252
const response = await client.episodes.bulkRetrieve({
5353
ids: '77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwf',

0 commit comments

Comments
 (0)