diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ad4dff7..8e7f137 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: - node-version: [16, 18, 20, 22] + node-version: [18, 20, 22] steps: - uses: actions/checkout@v3 @@ -37,3 +37,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm run prepublish + + - run: node example.mjs + env: + PRODIA_TOKEN: ${{ secrets.PRODIA_TOKEN }} diff --git a/example.ts b/example.mjs similarity index 66% rename from example.ts rename to example.mjs index fb45ffb..6266051 100644 --- a/example.ts +++ b/example.mjs @@ -1,12 +1,13 @@ -import { createProdia } from "./v2"; +import { createProdia } from "./dist/v2/index.js"; +import { strictEqual } from "assert"; -const token = Deno.env.get("PRODIA_TOKEN"); +const token = process.env.PRODIA_TOKEN; if (typeof token !== "string") { throw new Error("PRODIA_TOKEN is not set"); } -const isJpeg = (image: ArrayBuffer): boolean => { +const isJpeg = (image) => { const view = new Uint8Array(image); return view[0] === 0xff && view[1] === 0xd8; @@ -28,4 +29,4 @@ const job = await client.job({ const image = await job.arrayBuffer(); -assertEquals(isJpeg(image), true, "Image should be a JPEG"); \ No newline at end of file +strictEqual(isJpeg(image), true, "Image should be a JPEG");