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
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { RpcInterface } from './types';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
import { MockProvider } from '@polkadot/rpc-provider/mock';
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
import type { DefinitionRpc } from '@polkadot/types/types';
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { RpcInterface } from './types';
import { MockProvider } from '@polkadot/rpc-provider/mock';
+9 -2
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { of, timer } from 'rxjs';
import { drr } from '.';
@@ -17,7 +20,9 @@ describe('drr', (): void => {
expect(count).toBe(1);
sub.unsubscribe();
setTimeout(done, 2000);
setTimeout(() => {
done();
}, 2000);
}, 50);
});
@@ -31,7 +36,9 @@ describe('drr', (): void => {
const sub = obs.subscribe((value): void => {
expect(value > 1).toBe(true);
setTimeout(done, 2000);
setTimeout(() => {
done();
}, 2000);
});
sub.unsubscribe();