Adjust tests for node:test env (#5509)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user