diff --git a/jest.config.js b/jest.config.js index 8e648ca2..9f353fa7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ module.exports = { - roots: ["/demo/static"], + roots: ["/demo/static", "/tests"], transform: { "^.+\\.ts?$": "ts-jest" }, diff --git a/demo/static/tests/core/__snapshots__/component.test.ts.snap b/tests/__snapshots__/component.test.ts.snap similarity index 100% rename from demo/static/tests/core/__snapshots__/component.test.ts.snap rename to tests/__snapshots__/component.test.ts.snap diff --git a/demo/static/tests/core/__snapshots__/qweb_vdom.test.ts.snap b/tests/__snapshots__/qweb_vdom.test.ts.snap similarity index 100% rename from demo/static/tests/core/__snapshots__/qweb_vdom.test.ts.snap rename to tests/__snapshots__/qweb_vdom.test.ts.snap diff --git a/demo/static/tests/core/component.test.ts b/tests/component.test.ts similarity index 99% rename from demo/static/tests/core/component.test.ts rename to tests/component.test.ts index 67f40626..1c1a3cd4 100644 --- a/demo/static/tests/core/component.test.ts +++ b/tests/component.test.ts @@ -1,4 +1,4 @@ -import { Component, WEnv } from "../../../../src/component"; +import { Component, WEnv } from "../src/component"; import { makeDeferred, makeTestFixture, @@ -6,7 +6,7 @@ import { nextMicroTick, nextTick, normalize -} from "../helpers"; +} from "../demo/static/tests/helpers"; //------------------------------------------------------------------------------ // Setup and helpers diff --git a/demo/static/tests/core/event_bus.test.ts b/tests/event_bus.test.ts similarity index 95% rename from demo/static/tests/core/event_bus.test.ts rename to tests/event_bus.test.ts index 65ccdffa..dd4daf98 100644 --- a/demo/static/tests/core/event_bus.test.ts +++ b/tests/event_bus.test.ts @@ -1,4 +1,4 @@ -import { EventBus } from "../../../../src/event_bus"; +import { EventBus } from "../src/event_bus"; describe("event bus behaviour", () => { test("can subscribe and be notified", () => { diff --git a/demo/static/tests/core/qweb_vdom.test.ts b/tests/qweb_vdom.test.ts similarity index 98% rename from demo/static/tests/core/qweb_vdom.test.ts rename to tests/qweb_vdom.test.ts index 3861eccf..2dda5425 100644 --- a/demo/static/tests/core/qweb_vdom.test.ts +++ b/tests/qweb_vdom.test.ts @@ -1,8 +1,8 @@ -import sdAttributes from "../../../../libs/snabbdom/src/modules/attributes"; -import sdListeners from "../../../../libs/snabbdom/src/modules/eventlisteners"; -import { init } from "../../../../libs/snabbdom/src/snabbdom"; -import { EvalContext, QWeb } from "../../../../src/qweb_vdom"; -import { normalize } from "../helpers"; +import sdAttributes from "../libs/snabbdom/src/modules/attributes"; +import sdListeners from "../libs/snabbdom/src/modules/eventlisteners"; +import { init } from "../libs/snabbdom/src/snabbdom"; +import { EvalContext, QWeb } from "../src/qweb_vdom"; +import { normalize } from "../demo/static/tests/helpers"; //------------------------------------------------------------------------------ // Setup and helpers //------------------------------------------------------------------------------ diff --git a/demo/static/tests/core/utils.test.ts b/tests/utils.test.ts similarity index 98% rename from demo/static/tests/core/utils.test.ts rename to tests/utils.test.ts index 83bb2d12..78071c54 100644 --- a/demo/static/tests/core/utils.test.ts +++ b/tests/utils.test.ts @@ -5,7 +5,7 @@ import { memoize, debounce, findInTree -} from "../../../../src/utils"; +} from "../src/utils"; describe("escape", () => { test("normal strings", () => {