@webstudio-is/http-client 0.17.0 → 0.18.0
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/lib/index.test.js +10 -9
- package/package.json +4 -1
package/lib/index.test.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const globals_1 = require("@jest/globals");
|
|
3
4
|
const index_1 = require("./index");
|
|
4
5
|
const existingProjectId = "675e8af3-48fa-4b18-9ebf-fd2b128865e2";
|
|
5
6
|
const notPublishedProjectId = "7ec397c6-b3d0-4967-9073-9d83623fcf8e";
|
|
6
7
|
const onlyHomeProjectId = "36d6c16f-04a0-45d4-ab1d-aa0ab61eb5b6";
|
|
7
8
|
const morePagesProjectId = existingProjectId;
|
|
8
9
|
const apiUrl = "http://localhost:3000";
|
|
9
|
-
describe("getProjectDetails", () => {
|
|
10
|
-
test("include pages", async () => {
|
|
10
|
+
(0, globals_1.describe)("getProjectDetails", () => {
|
|
11
|
+
(0, globals_1.test)("include pages", async () => {
|
|
11
12
|
const response = await (0, index_1.loadProject)({
|
|
12
13
|
apiUrl,
|
|
13
14
|
projectId: morePagesProjectId,
|
|
14
15
|
});
|
|
15
16
|
if (typeof response === "object") {
|
|
16
|
-
return expect(response.length > 1).toBeTruthy();
|
|
17
|
+
return (0, globals_1.expect)(response.length > 1).toBeTruthy();
|
|
17
18
|
}
|
|
18
19
|
throw new Error("Unexpected response");
|
|
19
20
|
});
|
|
20
|
-
test("does not include pages", async () => {
|
|
21
|
+
(0, globals_1.test)("does not include pages", async () => {
|
|
21
22
|
const response = await (0, index_1.loadProject)({
|
|
22
23
|
apiUrl,
|
|
23
24
|
projectId: onlyHomeProjectId,
|
|
24
25
|
});
|
|
25
26
|
if (typeof response === "object") {
|
|
26
|
-
return expect(response.length === 1).toBeTruthy();
|
|
27
|
+
return (0, globals_1.expect)(response.length === 1).toBeTruthy();
|
|
27
28
|
}
|
|
28
29
|
throw new Error("Unexpected response");
|
|
29
30
|
});
|
|
30
|
-
test("loads existing project", async () => {
|
|
31
|
+
(0, globals_1.test)("loads existing project", async () => {
|
|
31
32
|
const response = await (0, index_1.loadProject)({
|
|
32
33
|
apiUrl,
|
|
33
34
|
projectId: existingProjectId,
|
|
34
35
|
});
|
|
35
|
-
expect(response).toBeTruthy();
|
|
36
|
+
(0, globals_1.expect)(response).toBeTruthy();
|
|
36
37
|
});
|
|
37
|
-
test("loads not published project", async () => {
|
|
38
|
+
(0, globals_1.test)("loads not published project", async () => {
|
|
38
39
|
const response = await (0, index_1.loadProject)({
|
|
39
40
|
apiUrl,
|
|
40
41
|
projectId: notPublishedProjectId,
|
|
@@ -43,7 +44,7 @@ describe("getProjectDetails", () => {
|
|
|
43
44
|
throw response;
|
|
44
45
|
}
|
|
45
46
|
if (typeof response === "string") {
|
|
46
|
-
return expect(response).toBe(`Project ${notPublishedProjectId} not found or not published yet. Please contact us to get help.`);
|
|
47
|
+
return (0, globals_1.expect)(response).toBe(`Project ${notPublishedProjectId} not found or not published yet. Please contact us to get help.`);
|
|
47
48
|
}
|
|
48
49
|
throw new Error("Unexpected response");
|
|
49
50
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/http-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Webstudio HTTP Client",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -14,10 +14,13 @@
|
|
|
14
14
|
"publish-to-npm": "bash ../../bin/publish-to-npm.sh"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
+
"@jest/globals": "^29.3.1",
|
|
17
18
|
"@types/isomorphic-fetch": "^0.0.36",
|
|
18
19
|
"@webstudio-is/jest-config": "*",
|
|
19
20
|
"@webstudio-is/prisma-client": "*",
|
|
20
21
|
"@webstudio-is/project": "*",
|
|
22
|
+
"@webstudio-is/tsconfig": "*",
|
|
23
|
+
"jest": "^29.3.1",
|
|
21
24
|
"tsup": "^6.1.3",
|
|
22
25
|
"typescript": "4.7.4"
|
|
23
26
|
},
|