Skip to content

Commit

Permalink
test: enable some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Jun 19, 2024
1 parent 6522de2 commit 871318f
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 175 deletions.
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"exclude": ["docs/dist.js", "docs/dist.min.js"],
"tasks": {
"test": "deno test -A",
"cov": "deno test --coverage -A",
"test": "deno test",
"cov": "deno test --coverage",
"lcov": "deno coverage --lcov cov > lcov.info",
"html_cov": "deno coverage --html",
"dist": "deno run -A jsr:@kt3k/pack mod.ts > docs/dist.js",
Expand Down
12 changes: 8 additions & 4 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function register(component: Component, name: string) {
// when deno_dom fixes add class.
el.classList.add(name);
el.classList.add(initClass);
el.addEventListener(`__ummount__:${name}`, () => {
el.addEventListener(`__unmount__:${name}`, () => {
el.classList.remove(initClass);
}, { once: true });

Expand Down Expand Up @@ -200,9 +200,13 @@ export function register(component: Component, name: string) {

registry[name] = initializer;

documentReady().then(() => {
mount(name);
});
if (document.readyState === "complete") {
mount();
} else {
documentReady().then(() => {
mount(name);
});
}
}

function addEventListener(
Expand Down
Loading

0 comments on commit 871318f

Please sign in to comment.