@dbos-inc/create 1.29.7-preview → 1.29.11-preview
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DBOS } from "@dbos-inc/dbos-sdk";
|
|
2
2
|
import { Hello, dbos_hello } from "./operations";
|
|
3
|
-
|
|
3
|
+
import request from "supertest";
|
|
4
4
|
|
|
5
5
|
describe("operations-test", () => {
|
|
6
6
|
beforeAll(async () => {
|
|
@@ -22,4 +22,15 @@ describe("operations-test", () => {
|
|
|
22
22
|
const rows = await DBOS.executor.queryUserDB("SELECT * FROM dbos_hello WHERE name=$1", ["dbos"]) as dbos_hello[];
|
|
23
23
|
expect(rows[0].greet_count).toBe(1);
|
|
24
24
|
});
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Test the HTTP endpoint.
|
|
28
|
+
*/
|
|
29
|
+
test("test-endpoint", async () => {
|
|
30
|
+
const res = await request(DBOS.getHTTPHandlersCallback()).get(
|
|
31
|
+
"/greeting/dbos"
|
|
32
|
+
);
|
|
33
|
+
expect(res.statusCode).toBe(200);
|
|
34
|
+
expect(res.text).toMatch("Hello, dbos! You have been greeted");
|
|
35
|
+
});
|
|
25
36
|
});
|