diff --git a/tests/tooling/debug_script_1.test.ts b/tests/tooling/debug_script_1.test.ts deleted file mode 100644 index e98ee121..00000000 --- a/tests/tooling/debug_script_1.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * We can only make one test per file, since the debug tool modify in place - * the owl object in a way that is difficult to undo. - */ - -// import { debugOwl } from "../../tools/debug"; -// import * as owl from "../../src/index"; - -// import { Component, Env } from "../../src/component/component"; -// import { xml } from "../../src/tags"; -// import { useState } from "../../src/hooks"; -// import { makeTestFixture, makeTestEnv, nextTick } from "../helpers"; - -// let fixture: HTMLElement = makeTestFixture(); -// let env: Env = makeTestEnv(); -// Component.env = env; - -// debugOwl(owl, {}); - -test.skip("can log full lifecycle", async () => { - // const steps: string[] = []; - // const log = console.log; - // console.log = (arg) => steps.push(arg); - // class Child extends Component { - // static template = xml`
child
`; - // } - // class Parent extends Component { - // static template = xml`
`; - // static components = { Child }; - // state = useState({ flag: false }); - // } - // const parent = new Parent(null, {}); - // await parent.mount(fixture); - // parent.state.flag = true; - // await nextTick(); - // expect(steps).toEqual([ - // "[OWL_DEBUG] Parent constructor, props={}", - // "[OWL_DEBUG] Parent mount", - // "[OWL_DEBUG] Parent willStart", - // "[OWL_DEBUG] Parent rendering template", - // "[OWL_DEBUG] Parent mounted", - // "[OWL_DEBUG] Parent render", - // "[OWL_DEBUG] Parent rendering template", - // "[OWL_DEBUG] Child constructor, props={}", - // "[OWL_DEBUG] Child willStart", - // "[OWL_DEBUG] Child rendering template", - // "[OWL_DEBUG] Parent willPatch", - // "[OWL_DEBUG] Child mounted", - // "[OWL_DEBUG] Parent patched", - // ]); - // console.log = log; -}); diff --git a/tests/tooling/debug_script_2.test.ts b/tests/tooling/debug_script_2.test.ts deleted file mode 100644 index ed2bedd2..00000000 --- a/tests/tooling/debug_script_2.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * We can only make one test per file, since the debug tool modify in place - * the owl object in a way that is difficult to undo. - */ - -// import { debugOwl } from "../../tools/debug"; -// import * as owl from "../../src/index"; - -// import { Component, Env } from "../../src/component/component"; -// import { xml } from "../../src/tags"; -// import { makeTestFixture, makeTestEnv } from "../helpers"; - -// let fixture: HTMLElement = makeTestFixture(); -// let env: Env = makeTestEnv(); -// Component.env = env; - -// debugOwl(owl, { logScheduler: true }); - -test.skip("can log scheduler start and stop", async () => { - // const steps: string[] = []; - // const log = console.log; - // console.log = (arg) => steps.push(arg); - // class Child extends Component { - // static template = xml`
child
`; - // } - // class Parent extends Component { - // static template = xml`
`; - // static components = { Child }; - // } - // const parent = new Parent(null, {}); - // await parent.mount(fixture); - // expect(steps).toEqual([ - // "[OWL_DEBUG] Parent constructor, props={}", - // "[OWL_DEBUG] Parent mount", - // "[OWL_DEBUG] Parent willStart", - // "[OWL_DEBUG] scheduler: start running tasks queue", - // "[OWL_DEBUG] Parent rendering template", - // "[OWL_DEBUG] Child constructor, props={}", - // "[OWL_DEBUG] Child willStart", - // "[OWL_DEBUG] Child rendering template", - // "[OWL_DEBUG] Child mounted", - // "[OWL_DEBUG] Parent mounted", - // "[OWL_DEBUG] scheduler: stop running tasks queue", - // ]); - // console.log = log; -}); diff --git a/tests/tooling/debug_script_3.test.ts b/tests/tooling/debug_script_3.test.ts deleted file mode 100644 index af1f0c3c..00000000 --- a/tests/tooling/debug_script_3.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * We can only make one test per file, since the debug tool modify in place - * the owl object in a way that is difficult to undo. - */ - -// import { debugOwl } from "../../tools/debug"; -// import * as owl from "../../src/index"; - -// import { Component, Env } from "../../src/component/component"; -// import { xml } from "../../src/tags"; -// import { makeTestFixture, makeTestEnv, nextTick } from "../helpers"; - -// let fixture: HTMLElement = makeTestFixture(); -// let env: Env = makeTestEnv(); -// Component.env = env; - -// debugOwl(owl, { logScheduler: true }); - -test.skip("log a specific message for render method calls if component is not mounted", async () => { - // const steps: string[] = []; - // const log = console.log; - // console.log = (arg) => steps.push(arg); - // class Parent extends Component { - // static template = xml`
`; - // state = owl.hooks.useState({ value: 1 }); - // } - // const parent = new Parent(null, {}); - // await parent.mount(fixture); - // parent.unmount(); - // parent.state.value = 2; - // await nextTick(); - // expect(steps).toEqual([ - // "[OWL_DEBUG] Parent constructor, props={}", - // "[OWL_DEBUG] Parent mount", - // "[OWL_DEBUG] Parent willStart", - // "[OWL_DEBUG] scheduler: start running tasks queue", - // "[OWL_DEBUG] Parent rendering template", - // "[OWL_DEBUG] Parent mounted", - // "[OWL_DEBUG] scheduler: stop running tasks queue", - // "[OWL_DEBUG] Parent willUnmount", - // "[OWL_DEBUG] Parent render (warning: component is not mounted)", - // "[OWL_DEBUG] scheduler: start running tasks queue", - // "[OWL_DEBUG] Parent rendering template", - // "[OWL_DEBUG] scheduler: stop running tasks queue", - // ]); - // console.log = log; -}); diff --git a/tests/tooling/debug_script_4.test.ts b/tests/tooling/debug_script_4.test.ts deleted file mode 100644 index 339a9074..00000000 --- a/tests/tooling/debug_script_4.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * We can only make one test per file, since the debug tool modify in place - * the owl object in a way that is difficult to undo. - */ - -// import { debugOwl } from "../../tools/debug"; -// import * as owl from "../../src/index"; - -// import { Component, Env } from "../../src/component/component"; -// import { xml } from "../../src/tags"; -// import { makeTestFixture, makeTestEnv } from "../helpers"; - -// let fixture: HTMLElement = makeTestFixture(); -// let env: Env = makeTestEnv(); -// Component.env = env; - -// debugOwl(owl, { logScheduler: true }); - -test.skip("log a sub component with non stringifiable props", async () => { - // const steps: string[] = []; - // const log = console.log; - // console.log = (arg) => steps.push(arg); - // class Child extends Component { - // static template = xml``; - // } - // const circularObject: any = { val: 1 }; - // circularObject.circularObject = circularObject; - // class Parent extends Component { - // static template = xml`
`; - // static components = { Child }; - // obj = circularObject; - // } - // const parent = new Parent(null, {}); - // await parent.mount(fixture); - // parent.unmount(); - // expect(steps).toEqual([ - // "[OWL_DEBUG] Parent constructor, props={}", - // "[OWL_DEBUG] Parent mount", - // "[OWL_DEBUG] Parent willStart", - // "[OWL_DEBUG] scheduler: start running tasks queue", - // "[OWL_DEBUG] Parent rendering template", - // "[OWL_DEBUG] Child constructor, props=", - // "[OWL_DEBUG] Child willStart", - // "[OWL_DEBUG] Child rendering template", - // "[OWL_DEBUG] Child mounted", - // "[OWL_DEBUG] Parent mounted", - // "[OWL_DEBUG] scheduler: stop running tasks queue", - // "[OWL_DEBUG] Parent willUnmount", - // "[OWL_DEBUG] Child willUnmount", - // ]); - // console.log = log; -});