Skip to content

Commit

Permalink
chore: add wasm pacakge test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jul 17, 2024
1 parent ba4183f commit 2efeb26
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/integrate-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@types/node": "^20.14.9",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"canvaskit-wasm": "^0.39.1",
"ipaddr.js": "^2.2.0",
"postgres": "^3.4.4",
"react": "^18.3.1",
Expand Down
11 changes: 11 additions & 0 deletions packages/integrate-module/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { renderToString } from 'react-dom/server'
import { simpleGit } from 'simple-git'
import ipaddr from 'ipaddr.js'
import postgres from 'postgres'
import canvaskit from 'canvaskit-wasm'

import { CompiledClass } from './compiled.js'
import { foo } from './foo.mjs'
Expand Down Expand Up @@ -72,3 +73,13 @@ await test('resolve postgres', () => {
const sql = postgres()
assert.ok(sql)
})

await test('resolve canvaskit-wasm', async () => {
if (process.arch === 's390x') {
assert.ok('skipping test on s390x')
return
}
// @ts-expect-error
const canvas = await canvaskit()
assert.ok(canvas.MakeSurface(100, 100))
})
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2efeb26

Please sign in to comment.