Skip to content

Commit db0a5d2

Browse files
committed
chore: generate files during tests in CI
1 parent 11e5aba commit db0a5d2

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ jobs:
2828
sqlc-version: '1.27.0'
2929
- uses: oven-sh/setup-bun@v2
3030
- run: wget https://github.com/bytecodealliance/javy/releases/download/v4.0.0/javy-x86_64-linux-v4.0.0.gz
31-
- run: gzip -d javy-x86_64-linux-v4.0.0.gz
32-
- run: chmod +x javy-x86_64-linux-v4.0.0
31+
- run: gzip -d javy-x86_64-linux-v4.0.0.gz -c > ./javy
32+
- run: chmod +x ./javy
3333
- run: bun install
34-
- run: bun build --entrypoints ./src/app.ts --outfile=out.js --minify --target browser
35-
- run: ./javy-x86_64-linux-v4.0.0 build out.js -o plugin.wasm
3634
- name: Run tests
37-
run: cd test && bun run test
35+
run: bun run test
3836
- id: calculate_sha256
3937
run: |
4038
sha256sum plugin.wasm > plugin.wasm.sha256

test/cases/aggregate.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { expect, it, describe } from "bun:test";
2-
import { db, prepare, sql } from "../case";
3-
import { aggEmails } from "./aggregate_sql";
4-
2+
import { db, gen, prepare, sql } from "../case";
53
await prepare(sql`
64
-- name: AggEmails :one
75
SELECT array_agg(e.id::text)::text[] AS emails FROM emails e;
86
`);
97

108
describe("aggregation", () => {
119
it("returns an array type", async () => {
12-
// this should not have any LSP error
13-
const result = (await aggEmails(db)) as string[];
10+
const result = await gen().aggEmails(db);
1411

1512
expect(result).toHaveLength(3);
1613
expect(Array.isArray(result)).toBe(true);

0 commit comments

Comments
 (0)