Skip to content

Commit

Permalink
chore: generate files during tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eEQK committed Feb 9, 2025
1 parent 11e5aba commit db0a5d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ jobs:
sqlc-version: '1.27.0'
- uses: oven-sh/setup-bun@v2
- run: wget https://github.com/bytecodealliance/javy/releases/download/v4.0.0/javy-x86_64-linux-v4.0.0.gz
- run: gzip -d javy-x86_64-linux-v4.0.0.gz
- run: chmod +x javy-x86_64-linux-v4.0.0
- run: gzip -d javy-x86_64-linux-v4.0.0.gz -c > ./javy
- run: chmod +x ./javy
- run: bun install
- run: bun build --entrypoints ./src/app.ts --outfile=out.js --minify --target browser
- run: ./javy-x86_64-linux-v4.0.0 build out.js -o plugin.wasm
- name: Run tests
run: cd test && bun run test
run: bun run test
- id: calculate_sha256
run: |
sha256sum plugin.wasm > plugin.wasm.sha256
Expand Down
7 changes: 2 additions & 5 deletions test/cases/aggregate.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { expect, it, describe } from "bun:test";
import { db, prepare, sql } from "../case";
import { aggEmails } from "./aggregate_sql";

import { db, gen, prepare, sql } from "../case";
await prepare(sql`
-- name: AggEmails :one
SELECT array_agg(e.id::text)::text[] AS emails FROM emails e;
`);

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

expect(result).toHaveLength(3);
expect(Array.isArray(result)).toBe(true);
Expand Down

0 comments on commit db0a5d2

Please sign in to comment.