Skip to content

Commit a151822

Browse files
added test to check the error msg
1 parent c25a86a commit a151822

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/request.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,16 @@ describe('Request tests', () => {
2424

2525
await expect(getData(client, url)).rejects.toThrowError(errorMessage);
2626
});
27+
28+
it('should throw error when host is required for live preview', async () => {
29+
const client = httpClient({});
30+
const url = '/your-api-endpoint';
31+
client.stackConfig = {
32+
live_preview: {
33+
enable: true,
34+
preview_token: 'someToken',
35+
},
36+
};
37+
await expect(getData(client, url, {})).rejects.toThrowError('Host is required for live preview');
38+
});
2739
});

0 commit comments

Comments
 (0)