bits-to-dead-trees 2.1.1 → 2.2.1
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/.tool-versions +1 -1
- package/CHANGELOG.md +12 -0
- package/Dockerfile +1 -1
- package/package.json +11 -11
- package/test/smoke.test.js +30 -26
package/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
nodejs 18.
|
|
1
|
+
nodejs 18.15.0
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# bits-to-dead-trees
|
|
2
2
|
|
|
3
|
+
## 2.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#179](https://github.com/rmehner/bits-to-dead-trees/pull/179) [`b67c364`](https://github.com/rmehner/bits-to-dead-trees/commit/b67c364c4f520b0ef2884f3ee3dbf5c5d69bca78) Thanks [@depfu](https://github.com/apps/depfu)! - Bump Playwright to 1.32.2
|
|
8
|
+
|
|
9
|
+
## 2.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`f9f42da`](https://github.com/rmehner/bits-to-dead-trees/commit/f9f42dacb00b9329c5aea56fd62a64fd5517b786) Thanks [@rmehner](https://github.com/rmehner)! - Upgrade Playwright to 1.32.1
|
|
14
|
+
|
|
3
15
|
## 2.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/Dockerfile
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bits-to-dead-trees",
|
|
3
3
|
"author": "Robin Mehner <robin@coding-robin.de>",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"description": "Turn HTML into PDF files",
|
|
6
6
|
"repository": "github:rmehner/bits-to-dead-trees",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
"ts-check": "npx tsc --noEmit"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"fastify": "^4.
|
|
34
|
-
"playwright-core": "^1.
|
|
33
|
+
"fastify": "^4.15.0",
|
|
34
|
+
"playwright-core": "^1.32.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@changesets/changelog-github": "^0.4.8",
|
|
38
|
-
"@changesets/cli": "^2.26.
|
|
39
|
-
"@types/lodash": "^4.14.
|
|
40
|
-
"eslint": "^8.
|
|
41
|
-
"eslint-config-prettier": "^8.
|
|
42
|
-
"nodemon": "^2.0.
|
|
43
|
-
"pino-pretty": "^
|
|
44
|
-
"prettier": "^2.8.
|
|
38
|
+
"@changesets/cli": "^2.26.1",
|
|
39
|
+
"@types/lodash": "^4.14.192",
|
|
40
|
+
"eslint": "^8.37.0",
|
|
41
|
+
"eslint-config-prettier": "^8.8.0",
|
|
42
|
+
"nodemon": "^2.0.22",
|
|
43
|
+
"pino-pretty": "^10.0.0",
|
|
44
|
+
"prettier": "^2.8.7",
|
|
45
45
|
"tslib": "^2.5.0",
|
|
46
46
|
"typescript-json-schema": "^0.55.0",
|
|
47
|
-
"vitest": "^0.
|
|
47
|
+
"vitest": "^0.29.8"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/test/smoke.test.js
CHANGED
|
@@ -3,34 +3,38 @@ import { describe, expect, it } from "vitest";
|
|
|
3
3
|
import build from "../app";
|
|
4
4
|
const app = build();
|
|
5
5
|
|
|
6
|
-
describe(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
6
|
+
describe(
|
|
7
|
+
"Smoke tests",
|
|
8
|
+
() => {
|
|
9
|
+
it("sends the PDF on the success case", async () => {
|
|
10
|
+
const response = await app.inject({
|
|
11
|
+
method: "POST",
|
|
12
|
+
url: "/pdf",
|
|
13
|
+
payload: { url: "https://coding-robin.de" },
|
|
14
|
+
});
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
const response = await app.inject({
|
|
19
|
-
method: "POST",
|
|
20
|
-
url: "/pdf",
|
|
21
|
-
payload: {
|
|
22
|
-
url: "http://httpbin.org/status/404",
|
|
23
|
-
},
|
|
16
|
+
expect(response.payload.startsWith("%PDF")).toBeTruthy();
|
|
24
17
|
});
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
it("returns an error object when the page could not be loaded", async () => {
|
|
20
|
+
const response = await app.inject({
|
|
21
|
+
method: "POST",
|
|
22
|
+
url: "/pdf",
|
|
23
|
+
payload: {
|
|
24
|
+
url: "http://httpbin.org/status/404",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
expect(response.statusCode).toEqual(404);
|
|
29
|
+
const error = JSON.parse(response.body);
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
expect(error).toMatchObject({
|
|
32
|
+
error: true,
|
|
33
|
+
status: 404,
|
|
34
|
+
statusText: "NOT FOUND",
|
|
35
|
+
message: "",
|
|
36
|
+
});
|
|
34
37
|
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
38
|
+
},
|
|
39
|
+
{ timeout: 10_000 }
|
|
40
|
+
);
|