add nodejs specific tests

This commit is contained in:
Kevin Jahns 2024-12-18 14:34:26 +01:00
parent d4d4ae5f53
commit 4404d090e4

View File

@ -15,15 +15,28 @@ import * as relativePositions from './relativePositions.tests.js'
import { runTests } from 'lib0/testing' import { runTests } from 'lib0/testing'
import { isBrowser, isNode } from 'lib0/environment' import { isBrowser, isNode } from 'lib0/environment'
import * as log from 'lib0/logging' import * as log from 'lib0/logging'
import { environment } from 'lib0'
if (isBrowser) { if (isBrowser) {
log.createVConsole(document.body) log.createVConsole(document.body)
} }
runTests({
/**
* @type {any}
*/
const tests = {
doc, map, array, text, xml, encoding, undoredo, compatibility, snapshot, updates, relativePositions 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 */ /* istanbul ignore next */
if (isNode) { if (isNode) {
process.exit(success ? 0 : 1) process.exit(success ? 0 : 1)
} }
}) }
run()