@tscircuit/fake-snippets 0.0.30 → 0.0.32

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.
@@ -1,6 +1,5 @@
1
1
  import { getTestServer } from "bun-tests/fake-snippets-api/fixtures/get-test-server"
2
2
  import { expect, test } from "bun:test"
3
- import { packageSchema } from "fake-snippets-api/lib/db/schema"
4
3
 
5
4
  test("GET /api/packages/get - should return package by package_id", async () => {
6
5
  const { axios } = await getTestServer()
@@ -57,3 +56,24 @@ test("GET /api/packages/get - should return 404 if package not found", async ()
57
56
  )
58
57
  }
59
58
  })
59
+
60
+ test("GET /api/packages/get - should return package by name", async () => {
61
+ const { axios } = await getTestServer()
62
+
63
+ await axios.post("/api/packages/create", {
64
+ name: "test-package",
65
+ description: "A test package",
66
+ creator_account_id: "test_account_id",
67
+ owner_org_id: "test_org_id",
68
+ owner_github_username: "test_github_username",
69
+ })
70
+
71
+ const getResponse = await axios.get("/api/packages/get", {
72
+ params: { name: "test-package" },
73
+ })
74
+
75
+ expect(getResponse.status).toBe(200)
76
+ const responseBody = getResponse.data
77
+ expect(responseBody.ok).toBe(true)
78
+ expect(responseBody.package).toBeDefined()
79
+ })