Run the slow specs again

- Removes the skip from Bounties and CreateAccount.
- test:slow runs only the .slow. specs.
- Each step waits up to 20s instead of the 1s default, since it waits on a
  live chain. The previous setting is restored when the file ends.
- assertDevNode fails a spec at once when no dev node answers. Without it the
  api keeps reconnecting and the spec waits until the job's timeout.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-10-11 23:12:51 +04:00
1 parent 29f7a91552
commit bea09e39c8
5 files changed
+63 -14

No files matched your search

@@ -0,0 +1,26 @@
// Copyright 2017-2026 @pezkuwi/test-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { BIZINIKIWI_PORT } from './constants.js';
/**
* Fails at once when no dev node answers on BIZINIKIWI_PORT. Without it an
* api keeps reconnecting and a spec waits until the job's timeout.
*/
export async function assertDevNode (timeoutMs = 5_000): Promise<void> {
const url = `http://127.0.0.1:${BIZINIKIWI_PORT}`;
const res = await fetch(url, {
body: JSON.stringify({ id: 1, jsonrpc: '2.0', method: 'system_chain' }),
headers: { 'Content-Type': 'application/json' },
method: 'POST',
signal: AbortSignal.timeout(timeoutMs)
}).catch((error: Error) => error);
if (res instanceof Error || !res.ok) {
const reason = res instanceof Error
? res.message
: `HTTP ${res.status}`;
throw new Error(`No dev node answers on ${url} (${reason}); the .slow. specs need one`);
}
}
@@ -1,4 +1,5 @@
// Copyright 2017-2026 @pezkuwi/test-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './assertDevNode.js';
export * from './constants.js';