Adjust tests for node:test env (#5509)
This commit is contained in:
@@ -5,7 +5,7 @@ import type { MetadataLatest, SiLookupTypeId } from '@polkadot/types/interfaces'
|
||||
import type { PortableRegistry } from '@polkadot/types/metadata';
|
||||
import type { Codec, DefinitionRpcParam } from '@polkadot/types/types';
|
||||
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
|
||||
import { Metadata, TypeRegistry, Vec } from '@polkadot/types';
|
||||
import * as definitions from '@polkadot/types/interfaces/definitions';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// eslint-disable-next-line spaced-comment
|
||||
/// <reference types="@polkadot/dev/node/test/node" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
import { getSimilarTypes } from './derived';
|
||||
|
||||
describe('getSimilarTypes', (): void => {
|
||||
let registry: TypeRegistry;
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
const mockImports = {
|
||||
codecTypes: {},
|
||||
definitions: {},
|
||||
@@ -22,10 +24,6 @@ describe('getSimilarTypes', (): void => {
|
||||
typesTypes: {}
|
||||
};
|
||||
|
||||
beforeAll((): void => {
|
||||
registry = new TypeRegistry();
|
||||
});
|
||||
|
||||
it('handles nested Tuples', (): void => {
|
||||
expect(getSimilarTypes(registry, {}, '(AccountId, (Balance, u32), u64)', mockImports)).toEqual([
|
||||
'ITuple<[AccountId, ITuple<[Balance, u32]>, u64]>',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import process from 'process';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import process from 'node:process';
|
||||
|
||||
import { packageInfo } from '../packageInfo';
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// eslint-disable-next-line spaced-comment
|
||||
/// <reference types="@polkadot/dev/node/test/node" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
|
||||
import { formatType } from './formatting';
|
||||
|
||||
Reference in New Issue
Block a user