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
@@ -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 -1
View File
@@ -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';
+4 -6
View File
@@ -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]>',
+3 -3
View File
@@ -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';