npm package diff
Package: @forge/sql
Versions: 2.4.3-next.0-experimental-f55f6f2 - 2.5.0-next.1
File: package/out/__test__/sql.test.js
Index: package/out/__test__/sql.test.js
===================================================================
--- package/out/__test__/sql.test.js
+++ package/out/__test__/sql.test.js
@@ -138,37 +138,20 @@
await expect(sqlClient.executeRaw('INVALID SQL QUERY')).rejects.toThrow(new errors_1.ForgeSQLAPIError(mockResponse, forgeError));
});
});
describe('_provision', () => {
- it('should work if the response is a 201', async () => {
+ it('should do nothing', async () => {
const mockResponse = new Response(JSON.stringify({ success: true }), {
status: 201,
statusText: 'OK'
});
mockFetch.mockResolvedValue(mockResponse);
- await sqlClient._provision();
- expect(mockFetch).toHaveBeenCalledWith('/api/v1/provision', expect.objectContaining({ method: 'POST' }));
+ await expect(sqlClient._provision()).resolves.toBeUndefined();
+ expect(mockFetch).not.toHaveBeenCalled();
});
- it('should work if the response is a 204', async () => {
- const mockResponse = new Response(undefined, {
- status: 204,
- statusText: 'OK'
- });
- mockFetch.mockResolvedValue(mockResponse);
- await sqlClient._provision();
- expect(mockFetch).toHaveBeenCalledWith('/api/v1/provision', expect.objectContaining({ method: 'POST' }));
- });
- it('should throw an error if the response is not 201 or 204', async () => {
- const mockResponse = new Response('Server Error', {
- status: 500,
- statusText: 'Bad Request'
- });
- mockFetch.mockResolvedValue(mockResponse);
- await expect(sqlClient._provision()).rejects.toThrow('Unexpected error in provision request');
- });
});
describe('executeDDL', () => {
- it('should return a valid Result object when DDL query gexecuted successfully', async () => {
+ it('should return a valid Result object when DDL query executed successfully', async () => {
const mockResponse = {
ok: true,
status: 200,
text: jest.fn().mockResolvedValue(JSON.stringify({ success: true }))