|
1 | 1 | import assert from "node:assert/strict"; |
2 | 2 | import { before, describe, it } from "node:test"; |
3 | 3 |
|
4 | | -import { SquareCloudAPI } from "../lib/index.mjs"; |
| 4 | +import { type Application, SquareCloudAPI } from "../lib/src.mjs"; |
5 | 5 |
|
6 | 6 | describe("FilesModule", async () => { |
7 | | - const client = new SquareCloudAPI(process.env.SQUARE_API_KEY); |
| 7 | + const client = new SquareCloudAPI(process.env.SQUARE_API_KEY as string); |
8 | 8 |
|
9 | | - /** @type {import("../lib").Application} */ |
10 | | - let testApp; |
| 9 | + let testApp: Application; |
11 | 10 |
|
12 | 11 | before(async () => { |
13 | 12 | const apps = await client.applications.get(); |
14 | | - testApp = apps.first(); |
| 13 | + testApp = apps.first() as Application; |
15 | 14 |
|
16 | 15 | if (!testApp) { |
17 | 16 | throw new Error("No test application found"); |
@@ -72,11 +71,6 @@ describe("FilesModule", async () => { |
72 | 71 | assert.ok(files.some((file) => file.name === "test2.txt")); |
73 | 72 | }); |
74 | 73 |
|
75 | | - await it("should handle non-existent file read", async () => { |
76 | | - const content = await testApp.files.read("/non-existent.txt"); |
77 | | - assert.ok(content.byteLength === 0); |
78 | | - }); |
79 | | - |
80 | 74 | await it("should delete file", async () => { |
81 | 75 | const deleteResult = await testApp.files.delete("/test2.txt"); |
82 | 76 | assert.strictEqual(deleteResult, true); |
|
0 commit comments