From 4404d090e424a096a5e3f1977f4ff13000d95480 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 18 Dec 2024 14:34:26 +0100 Subject: [PATCH] add nodejs specific tests --- tests/index.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/index.js b/tests/index.js index ec22ed05..fd9c08e7 100644 --- a/tests/index.js +++ b/tests/index.js @@ -15,15 +15,28 @@ import * as relativePositions from './relativePositions.tests.js' import { runTests } from 'lib0/testing' import { isBrowser, isNode } from 'lib0/environment' import * as log from 'lib0/logging' +import { environment } from 'lib0' if (isBrowser) { log.createVConsole(document.body) } -runTests({ + +/** + * @type {any} + */ +const tests = { doc, map, array, text, xml, encoding, undoredo, compatibility, snapshot, updates, relativePositions -}).then(success => { +} + +const run = async () => { + if (environment.isNode) { + // tests.nodejs = await import('./node.tests.js') + } + + const success = await runTests(tests) /* istanbul ignore next */ if (isNode) { process.exit(success ? 0 : 1) } -}) +} +run()