Adjust tests for node:test env (#5509)

This commit is contained in:
Jaco
2023-02-25 11:48:26 +02:00
committed by GitHub
parent beb7b54e4a
commit a8d7566186
151 changed files with 674 additions and 950 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
"version": "9.14.3-2-x",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@babel/runtime": "^7.21.0",
"@polkadot/api-augment": "9.14.3-2-x",
"@polkadot/api-base": "9.14.3-2-x",
"@polkadot/api-derive": "9.14.3-2-x",
+4 -1
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { UnsubscribePromise } from '../types';
import { Combinator } from './Combinator';
@@ -84,7 +87,7 @@ describe('Combinator', (): void => {
it('unsubscribes as required', (done): void => {
// eslint-disable-next-line @typescript-eslint/require-await
const mocker = async (): Promise<any> => done;
const mocker = () => Promise.resolve(done);
const combinator = new Combinator([
mocker,
// eslint-disable-next-line @typescript-eslint/require-await
+4 -1
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { HexString } from '@polkadot/util/types';
import type { SubmittableExtrinsic } from '../types';
@@ -101,7 +104,7 @@ describe('ApiPromise', (): void => {
await api.disconnect();
fail('Expected an error but none occurred.');
throw new Error('Expected an error but none occurred.');
} catch {
// Pass
}
+4 -1
View File
@@ -1,10 +1,13 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { augmentObject } from './augmentObject';
describe('augmentObject', (): void => {
let spy: jest.SpyInstance;
let spy: ReturnType<typeof jest.spyOn>;
beforeEach((): void => {
spy = jest.spyOn(console, 'warn');
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { decorateStorage, Metadata, TypeRegistry } from '@polkadot/types';
import metaStatic from '@polkadot/types-support/metadata/static-substrate';