Skip to content

Commit e81b172

Browse files
🔀 Check for https in the API base url (#54)
GIVEN I am an API user using the JavaScript SDK WHEN I pass a URL like http://my.unstructuredapp.io/general/v0 to the API SDK THEN the client object should give me a warning that they entered an http url instead of https SO I am not confused by getting a 404 when I try to make an API call
1 parent c42212f commit e81b172

File tree

9 files changed

+7998
-2118
lines changed

9 files changed

+7998
-2118
lines changed

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ install:
2222
build:
2323
npm run build
2424

25+
#############
26+
# Test #
27+
#############
28+
29+
## test-unit: run unit tests
30+
.PHONY: test-unit
31+
test-unit:
32+
npx jest --config jest.config.js test/unit
33+
34+
## test: run all tests
35+
.PHONY: test
36+
test: test-unit
37+
2538
#############
2639
# Speakeasy #
2740
#############

gen.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ typescript:
1717
pdf-lib: ^1.17.1
1818
devDependencies:
1919
'@types/async': ^3.2.24
20+
'@types/jest': ^29.5.12
21+
jest: ^29.7.0
22+
ts-jest: ^29.1.2
2023
peerDependencies: {}
2124
author: Unstructured
2225
clientServerStatusCodesAsErrors: true

jest.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: "ts-jest",
4+
testEnvironment: "node",
5+
};

0 commit comments

Comments
 (0)