// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
// SPDX-License-Identifier: GPL-3.0-or-later
+import './test.test.mjs'
import './create-wallet.test.mjs'
import './derive-accounts.test.mjs'
import './import-wallet.test.mjs'
--- /dev/null
+// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+'use strict'
+
+import { assert, skip, test } from '#GLOBALS.mjs'
+
+function testTheTests () {
+ // Replace console.log with stub implementation.
+ const console_log = console.log
+ const calls = []
+ console.log = (...args) => {
+ calls.push(args)
+ console_log(...args)
+ }
+
+ try {
+ console.assert(calls.length == 0)
+
+ test('good promise', new Promise(resolve => resolve()))
+ console.assert(calls.length == 1)
+ console.assert(calls[0][0] === 'PASS: good promise')
+
+ test('bad promise', new Promise((resolve, reject) => reject()))
+ console.assert(calls.length == 2)
+ console.assert(calls[1][0] === 'FAIL: bad promise')
+
+ test('good async', async () => { })
+ console.assert(calls.length == 3)
+ console.assert(calls[2][0] === 'PASS: good async')
+
+ test('bad async', async () => { throw new Error('msg') })
+ console.assert(calls.length == 4)
+ console.assert(calls[3][0] === 'PASS: bad async: msg')
+
+ test('good function', () => { })
+ console.assert(calls.length == 5)
+ console.assert(calls[4][0] === 'PASS: good function')
+
+ test('bad function', null)
+ console.assert(calls.length == 6)
+ console.assert(calls[5][0] === 'FAIL: bad function')
+
+ } catch (error) {
+ console.error(error)
+ } finally {
+ // Restore original implementation after testing.
+ console.log = console_log
+ }
+}