Skip to content

Commit

Permalink
ci: explicit type checking since dynamic imports aren't type checked
Browse files Browse the repository at this point in the history
  • Loading branch information
b-fuze committed May 26, 2024
1 parent 3f6ca91 commit 3409b1c
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/deno-dom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ jobs:
- name: Check code formatting
run: deno fmt --check --unstable

# We check in a separate step because dynamic imports
# no longer type check at runtime which we need for
# invoking the unit tests
- name: Check TypeScript types
run: deno task type-check

- name: Run tests
run: deno test --allow-read --allow-net wasm.test.ts
run: deno test --no-check --allow-read --allow-net wasm.test.ts
8 changes: 7 additions & 1 deletion deno-dom-wasm-noinit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import { register } from "./src/parser.ts";

export async function initParser() {
await initWasm();
register(parse, parseFrag);
register(
parse,
parseFrag as unknown as (
html: string,
context_local_name?: string,
) => string,
);
}

export * from "./src/api.ts";
3 changes: 3 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"./html-parser",
"./.vim"
]
},
"tasks": {
"type-check": "deno check ./deno-dom-wasm.ts ./deno-dom-wasm-noinit.ts ./deno-dom-native.ts ./native.test.ts ./wasm.test.ts ./test/units/*.ts"
}
}
116 changes: 115 additions & 1 deletion deno.lock

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

0 comments on commit 3409b1c

Please sign in to comment.