Skip to content

Commit a9a03f1

Browse files
committed
Fix URL construction
1 parent 2c77291 commit a9a03f1

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/apiClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from 'path'
21
import { createIntegreSQLApiClientError } from './apiClientError'
32
import { GetTestDatabaseResponse, InitializeTemplateResponse } from './interfaces'
43

@@ -19,7 +18,7 @@ export class IntegreSQLApiClient {
1918
endpoint: string,
2019
body?: Record<string, unknown>
2120
): Promise<T> {
22-
const url = path.join(this.baseUrl, endpoint)
21+
const url = this.baseUrl + endpoint
2322

2423
const response = await fetch(url, {
2524
method,

tests/__snapshots__/apiClient.spec.ts.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`apiClient endpoints can discard a template 1`] = `
44
[
55
[
6-
"http:/localhost:5000/api/v1/templates/mock-hash",
6+
"http://localhost:5000/api/v1/templates/mock-hash",
77
{
88
"body": undefined,
99
"headers": {
@@ -18,7 +18,7 @@ exports[`apiClient endpoints can discard a template 1`] = `
1818
exports[`apiClient endpoints can discard all templates 1`] = `
1919
[
2020
[
21-
"http:/localhost:5000/api/v1/admin/templates",
21+
"http://localhost:5000/api/v1/admin/templates",
2222
{
2323
"body": undefined,
2424
"headers": {
@@ -33,7 +33,7 @@ exports[`apiClient endpoints can discard all templates 1`] = `
3333
exports[`apiClient endpoints can finalize a template 1`] = `
3434
[
3535
[
36-
"http:/localhost:5000/api/v1/templates/mock-hash",
36+
"http://localhost:5000/api/v1/templates/mock-hash",
3737
{
3838
"body": undefined,
3939
"headers": {
@@ -48,7 +48,7 @@ exports[`apiClient endpoints can finalize a template 1`] = `
4848
exports[`apiClient endpoints can get a test database 1`] = `
4949
[
5050
[
51-
"http:/localhost:5000/api/v1/templates/mock-hash/tests",
51+
"http://localhost:5000/api/v1/templates/mock-hash/tests",
5252
{
5353
"body": undefined,
5454
"headers": {
@@ -63,7 +63,7 @@ exports[`apiClient endpoints can get a test database 1`] = `
6363
exports[`apiClient endpoints can initialize a template 1`] = `
6464
[
6565
[
66-
"http:/localhost:5000/api/v1/templates",
66+
"http://localhost:5000/api/v1/templates",
6767
{
6868
"body": "{"hash":"mock-hash"}",
6969
"headers": {
@@ -78,7 +78,7 @@ exports[`apiClient endpoints can initialize a template 1`] = `
7878
exports[`apiClient endpoints can recreate a test database 1`] = `
7979
[
8080
[
81-
"http:/localhost:5000/api/v1/templates/mock-hash/tests/42/recreate",
81+
"http://localhost:5000/api/v1/templates/mock-hash/tests/42/recreate",
8282
{
8383
"body": undefined,
8484
"headers": {
@@ -93,7 +93,7 @@ exports[`apiClient endpoints can recreate a test database 1`] = `
9393
exports[`apiClient endpoints can reuse a test database 1`] = `
9494
[
9595
[
96-
"http:/localhost:5000/api/v1/templates/mock-hash/tests/42",
96+
"http://localhost:5000/api/v1/templates/mock-hash/tests/42",
9797
{
9898
"body": undefined,
9999
"headers": {

0 commit comments

Comments
 (0)