diff options
author | Sebastian <sebasjm@gmail.com> | 2023-04-21 10:44:33 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-04-21 10:44:33 -0300 |
commit | 6dcc488a2c8fd681941e5d3b62bb04af7669888e (patch) | |
tree | fdd094ce0bea338ee90b1b7c47e4f232caa17716 /packages | |
parent | 3772ff85db61fd2260659e370e882d08d698f981 (diff) | |
download | wallet-core-6dcc488a2c8fd681941e5d3b62bb04af7669888e.tar.xz |
use better testing api
Diffstat (limited to 'packages')
-rw-r--r-- | packages/merchant-backoffice-ui/package.json | 2 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/src/stories.test.ts | 9 |
2 files changed, 3 insertions, 8 deletions
diff --git a/packages/merchant-backoffice-ui/package.json b/packages/merchant-backoffice-ui/package.json index ad7d2eb02..dc5668933 100644 --- a/packages/merchant-backoffice-ui/package.json +++ b/packages/merchant-backoffice-ui/package.json @@ -9,7 +9,7 @@ "check": "tsc", "compile": "tsc && ./build.mjs", "dev": "preact watch --port ${PORT:=8080} --no-sw --no-esm", - "test": "pnpm compile && mocha --require source-map-support/register 'dist/**/*.test.js' 'dist/**/test.js'", + "test": "mocha --require source-map-support/register 'dist/**/*.test.js' 'dist/**/test.js'", "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'", "i18n:extract": "pogen extract", "i18n:merge": "pogen merge", diff --git a/packages/merchant-backoffice-ui/src/stories.test.ts b/packages/merchant-backoffice-ui/src/stories.test.ts index e85be31b7..df732895f 100644 --- a/packages/merchant-backoffice-ui/src/stories.test.ts +++ b/packages/merchant-backoffice-ui/src/stories.test.ts @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ import { setupI18n } from "@gnu-taler/taler-util"; -import { parseGroupImport } from "@gnu-taler/web-util/lib/index.browser"; +import { parseGroupImport, tests } from "@gnu-taler/web-util/lib/index.browser"; import { h as create } from "preact"; import { render as renderToString } from "preact-render-to-string"; import * as admin from "./paths/admin/index.stories.js"; @@ -35,12 +35,7 @@ describe("All the examples:", () => { describe(`Component: ${component.name}`, () => { component.examples.forEach((example) => { it(`should render example: ${example.name}`, () => { - const vdom = create( - example.render.component, - example.render.props, - ); - const html = renderToString(vdom); - // console.log(html) + tests.renderUI(example.render); }); }); }); |