diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 44836998e1..d8d8c42bfa 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/accounts/test/account.access_key.test.ts b/packages/accounts/test/account.access_key.test.ts index 4149942eef..04264ac082 100644 --- a/packages/accounts/test/account.access_key.test.ts +++ b/packages/accounts/test/account.access_key.test.ts @@ -1,7 +1,7 @@ import { beforeAll, beforeEach, expect, test } from '@jest/globals'; import { KeyPair } from '@near-js/crypto'; -import testUtils from './test-utils'; +import { createAccount, deployContract, generateUniqueString, networkId, setUpTestConnection } from './test-utils'; let nearjs; let workingAccount; @@ -9,15 +9,15 @@ let contractId; let contract; beforeAll(async () => { - nearjs = await testUtils.setUpTestConnection(); + nearjs = await setUpTestConnection(); }); beforeEach(async () => { try { - contractId = testUtils.generateUniqueString('test'); - workingAccount = await testUtils.createAccount(nearjs); - contract = await testUtils.deployContract(nearjs.accountCreator.masterAccount, contractId); + contractId = generateUniqueString('test'); + workingAccount = await createAccount(nearjs); + contract = await deployContract(nearjs.accountCreator.masterAccount, contractId); } catch (e) { console.error(e); } @@ -28,8 +28,8 @@ test('make function call using access key', async() => { await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', '2000000000000000000000000'); // Override in the key store the workingAccount key to the given access key. - await nearjs.connection.signer.keyStore.setKey(testUtils.networkId, workingAccount.accountId, keyPair); - const setCallValue = testUtils.generateUniqueString('setCallPrefix'); + await nearjs.connection.signer.keyStore.setKey(networkId, workingAccount.accountId, keyPair); + const setCallValue = generateUniqueString('setCallPrefix'); await contract.setValue({ args: { value: setCallValue } }); expect(await contract.getValue()).toEqual(setCallValue); }); @@ -40,13 +40,13 @@ test('remove access key no longer works', async() => { await nearjs.accountCreator.masterAccount.addKey(publicKey, contractId, '', 400000); await nearjs.accountCreator.masterAccount.deleteKey(publicKey); // Override in the key store the workingAccount key to the given access key. - await nearjs.connection.signer.keyStore.setKey(testUtils.networkId, nearjs.accountCreator.masterAccount.accountId, keyPair); + await nearjs.connection.signer.keyStore.setKey(networkId, nearjs.accountCreator.masterAccount.accountId, keyPair); let failed = true; try { await contract.setValue({ args: { value: 'test' } }); failed = false; } catch (e) { - expect(e.message).toEqual(`Can not sign transactions for account ${nearjs.accountCreator.masterAccount.accountId} on network ${testUtils.networkId}, no matching key pair exists for this account`); + expect(e.message).toEqual(`Can not sign transactions for account ${nearjs.accountCreator.masterAccount.accountId} on network ${networkId}, no matching key pair exists for this account`); expect(e.type).toEqual('KeyNotFound'); } @@ -54,14 +54,14 @@ test('remove access key no longer works', async() => { throw new Error('should throw an error'); } - nearjs = await testUtils.setUpTestConnection(); + nearjs = await setUpTestConnection(); }); test('view account details after adding access keys', async() => { const keyPair = KeyPair.fromRandom('ed25519'); await nearjs.accountCreator.masterAccount.addKey(keyPair.getPublicKey(), contractId, '', 1000000000); - const contract2 = await testUtils.deployContract(nearjs.accountCreator.masterAccount, testUtils.generateUniqueString('test_contract2')); + const contract2 = await deployContract(nearjs.accountCreator.masterAccount, generateUniqueString('test_contract2')); const keyPair2 = KeyPair.fromRandom('ed25519'); await nearjs.accountCreator.masterAccount.addKey(keyPair2.getPublicKey(), contract2.contractId, '', 2000000000); @@ -96,7 +96,7 @@ test('loading account after adding a full key', async() => { test('load invalid key pair', async() => { // Override in the key store with invalid key pair - await nearjs.connection.signer.keyStore.setKey(testUtils.networkId, nearjs.accountCreator.masterAccount.accountId, ''); + await nearjs.connection.signer.keyStore.setKey(networkId, nearjs.accountCreator.masterAccount.accountId, ''); let failed = true; try { await contract.setValue({ args: { value: 'test' } }); diff --git a/packages/accounts/test/account.test.ts b/packages/accounts/test/account.test.ts index acd569d499..c6c45d4a89 100644 --- a/packages/accounts/test/account.test.ts +++ b/packages/accounts/test/account.test.ts @@ -5,16 +5,15 @@ import { BlockResult, TypedError } from '@near-js/types'; import * as fs from 'fs'; import { Account, Contract } from '../src'; -import testUtils from './test-utils'; +import { createAccount, generateUniqueString, HELLO_WASM_PATH, HELLO_WASM_BALANCE, networkId, setUpTestConnection } from './test-utils'; let nearjs; let workingAccount; -const { HELLO_WASM_PATH, HELLO_WASM_BALANCE } = testUtils; beforeAll(async () => { - nearjs = await testUtils.setUpTestConnection(); - workingAccount = await testUtils.createAccount(nearjs); + nearjs = await setUpTestConnection(); + workingAccount = await createAccount(nearjs); }); afterAll(async () => { @@ -27,10 +26,10 @@ test('view pre-defined account works and returns correct name', async () => { }); test('create account and then view account returns the created account', async () => { - const newAccountName = testUtils.generateUniqueString('test'); + const newAccountName = generateUniqueString('test'); const newAccountPublicKey = '9AhWenZ3JddamBoyMqnTbp7yVbRuvqAv3zwfrWgfVRJE'; const { amount } = await workingAccount.state(); - const newAmount = BigInt(amount) / BigInt(10); + const newAmount = BigInt(amount) / 10n; await nearjs.accountCreator.masterAccount.createAccount(newAccountName, newAccountPublicKey, newAmount); const newAccount = new Account(nearjs.connection, newAccountName); const state = await newAccount.state(); @@ -38,29 +37,29 @@ test('create account and then view account returns the created account', async ( }); test('send money', async() => { - const sender = await testUtils.createAccount(nearjs); - const receiver = await testUtils.createAccount(nearjs); + const sender = await createAccount(nearjs); + const receiver = await createAccount(nearjs); const { amount: receiverAmount } = await receiver.state(); - await sender.sendMoney(receiver.accountId, BigInt(10000)); + await sender.sendMoney(receiver.accountId, 10000n); const state = await receiver.state(); - expect(state.amount).toEqual((BigInt(receiverAmount) + BigInt(10000)).toString()); + expect(state.amount).toEqual((BigInt(receiverAmount) + 10000n).toString()); }); test('send money through signAndSendTransaction', async() => { - const sender = await testUtils.createAccount(nearjs); - const receiver = await testUtils.createAccount(nearjs); + const sender = await createAccount(nearjs); + const receiver = await createAccount(nearjs); const { amount: receiverAmount } = await receiver.state(); await sender.signAndSendTransaction({ receiverId: receiver.accountId, - actions: [actionCreators.transfer(BigInt(10000))], + actions: [actionCreators.transfer(10000n)], }); const state = await receiver.state(); - expect(state.amount).toEqual((BigInt(receiverAmount) + BigInt(10000)).toString()); + expect(state.amount).toEqual((BigInt(receiverAmount) + 10000n).toString()); }); test('delete account', async() => { - const sender = await testUtils.createAccount(nearjs); - const receiver = await testUtils.createAccount(nearjs); + const sender = await createAccount(nearjs); + const receiver = await createAccount(nearjs); await sender.deleteAccount(receiver.accountId); // @ts-expect-error test input const reloaded = new Account(sender.connection, sender); @@ -79,7 +78,7 @@ test('multiple parallel transactions', async () => { }); test('findAccessKey returns the same access key when fetched simultaneously', async() => { - const account = await testUtils.createAccount(nearjs); + const account = await createAccount(nearjs); const [key1, key2] = await Promise.all([ // @ts-expect-error test input @@ -119,11 +118,11 @@ describe('errors', () => { describe('with deploy contract', () => { let logs; - const contractId = testUtils.generateUniqueString('test_contract'); + const contractId = generateUniqueString('test_contract'); let contract; beforeAll(async () => { - const newPublicKey = await nearjs.connection.signer.createKey(contractId, testUtils.networkId); + const newPublicKey = await nearjs.connection.signer.createKey(contractId, networkId); const data = fs.readFileSync(HELLO_WASM_PATH); await nearjs.accountCreator.masterAccount.createAndDeployContract(contractId, newPublicKey, data, HELLO_WASM_BALANCE); // @ts-expect-error test input @@ -172,7 +171,7 @@ describe('with deploy contract', () => { }); expect(result).toEqual('hello trex'); - const setCallValue = testUtils.generateUniqueString('setCallPrefix'); + const setCallValue = generateUniqueString('setCallPrefix'); const result2 = await workingAccount.functionCall({ contractId, methodName: 'setValue', @@ -186,7 +185,7 @@ describe('with deploy contract', () => { }); test('view contract state', async() => { - const setCallValue = testUtils.generateUniqueString('setCallPrefix'); + const setCallValue = generateUniqueString('setCallPrefix'); await workingAccount.functionCall({ contractId, methodName: 'setValue', @@ -212,14 +211,14 @@ describe('with deploy contract', () => { const result = await contract.hello({ name: 'trex' }); expect(result).toEqual('hello trex'); - const setCallValue = testUtils.generateUniqueString('setCallPrefix'); + const setCallValue = generateUniqueString('setCallPrefix'); const result2 = await contract.setValue({ args: { value: setCallValue } }); expect(result2).toEqual(setCallValue); expect(await contract.getValue()).toEqual(setCallValue); }); test('view function calls by block Id and finality', async() => { - const setCallValue1 = testUtils.generateUniqueString('setCallPrefix'); + const setCallValue1 = generateUniqueString('setCallPrefix'); const result1 = await contract.setValue({ args: { value: setCallValue1 } }); expect(result1).toEqual(setCallValue1); expect(await contract.getValue()).toEqual(setCallValue1); @@ -251,7 +250,7 @@ describe('with deploy contract', () => { blockQuery: { blockId: blockIndex1 }, })).toEqual(setCallValue1); - const setCallValue2 = testUtils.generateUniqueString('setCallPrefix'); + const setCallValue2 = generateUniqueString('setCallPrefix'); const result2 = await contract.setValue({ args: { value: setCallValue2 } }); expect(result2).toEqual(setCallValue2); expect(await contract.getValue()).toEqual(setCallValue2); @@ -298,7 +297,7 @@ describe('with deploy contract', () => { }); test('make function calls via contract with gas', async() => { - const setCallValue = testUtils.generateUniqueString('setCallPrefix'); + const setCallValue = generateUniqueString('setCallPrefix'); const result2 = await contract.setValue({ args: { value: setCallValue }, gas: 1000000 * 1000000 diff --git a/packages/accounts/test/account_multisig.test.ts b/packages/accounts/test/account_multisig.test.ts index 19fb36c788..bb1b3101ce 100644 --- a/packages/accounts/test/account_multisig.test.ts +++ b/packages/accounts/test/account_multisig.test.ts @@ -7,7 +7,7 @@ import * as fs from 'fs'; import semver from 'semver'; import { Account2FA, MULTISIG_DEPOSIT, MULTISIG_GAS, MultisigStateStatus } from '../src'; -import testUtils from './test-utils'; +import { createAccount, setUpTestConnection } from './test-utils'; const { functionCall, transfer } = actionCreators; @@ -18,7 +18,6 @@ const getAccount2FA = async (account, keyMapping = ({ public_key: publicKey }) = // modifiers to functions replaces contract helper (CH) const { accountId } = account; const keys = await account.getAccessKeys(); - // @ts-expect-error test input const account2fa: any = new Account2FA(nearjs.connection, accountId, { // skip this (not using CH) getCode: () => {}, @@ -51,7 +50,7 @@ const getAccount2FA = async (account, keyMapping = ({ public_key: publicKey }) = }; beforeAll(async () => { - nearjs = await testUtils.setUpTestConnection(); + nearjs = await setUpTestConnection(); const nodeStatus = await nearjs.connection.provider.status(); startFromVersion = (version) => semver.gte(nodeStatus.version.version, version); console.log(startFromVersion); @@ -60,7 +59,7 @@ beforeAll(async () => { describe('deployMultisig key rotations', () => { test('full access key if recovery method is "ledger" or "phrase", limited access key if "phone"', async () => { - const account = await testUtils.createAccount(nearjs); + const account = await createAccount(nearjs); await account.addKey(KeyPair.fromRandom('ed25519').getPublicKey()); await account.addKey(KeyPair.fromRandom('ed25519').getPublicKey()); const keys = await account.getAccessKeys(); @@ -81,7 +80,7 @@ describe('deployMultisig key rotations', () => { describe('account2fa transactions', () => { test('add app key before deployMultisig', async() => { - let account = await testUtils.createAccount(nearjs); + let account = await createAccount(nearjs); const appPublicKey = KeyPair.fromRandom('ed25519').getPublicKey(); const appAccountId = 'foobar'; const appMethodNames = ['some_app_stuff','some_more_app_stuff']; @@ -97,7 +96,7 @@ describe('account2fa transactions', () => { }); test('add app key', async() => { - let account = await testUtils.createAccount(nearjs); + let account = await createAccount(nearjs); account = await getAccount2FA(account); const appPublicKey = KeyPair.fromRandom('ed25519').getPublicKey(); const appAccountId = 'foobar'; @@ -113,8 +112,8 @@ describe('account2fa transactions', () => { }); test('send money', async() => { - let sender = await testUtils.createAccount(nearjs); - let receiver = await testUtils.createAccount(nearjs); + let sender = await createAccount(nearjs); + let receiver = await createAccount(nearjs); sender = await getAccount2FA(sender); receiver = await getAccount2FA(receiver); const { amount: receiverAmount } = await receiver.state(); @@ -124,8 +123,8 @@ describe('account2fa transactions', () => { }); test('send money through signAndSendTransaction', async() => { - let sender = await testUtils.createAccount(nearjs); - let receiver = await testUtils.createAccount(nearjs); + let sender = await createAccount(nearjs); + let receiver = await createAccount(nearjs); sender = await getAccount2FA(sender); receiver = await getAccount2FA(receiver); const { amount: receiverAmount } = await receiver.state(); diff --git a/packages/accounts/test/contract.test.ts b/packages/accounts/test/contract.test.ts index cbd8de359e..bcee4ad006 100644 --- a/packages/accounts/test/contract.test.ts +++ b/packages/accounts/test/contract.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeAll, describe, expect, jest, test } from '@jest/global import { PositionalArgsError } from '@near-js/types'; import { Contract, Account } from '../src'; -import testUtils from './test-utils'; +import { deployContractGuestBook, generateUniqueString, setUpTestConnection } from './test-utils'; const account = Object.setPrototypeOf({ getConnection() { @@ -116,8 +116,8 @@ describe('local view execution', () => { jest.setTimeout(60000); beforeAll(async () => { - nearjs = await testUtils.setUpTestConnection(); - contract = await testUtils.deployContractGuestBook(nearjs.accountCreator.masterAccount, testUtils.generateUniqueString('guestbook')); + nearjs = await setUpTestConnection(); + contract = await deployContractGuestBook(nearjs.accountCreator.masterAccount, generateUniqueString('guestbook')); await contract.add_message({ text: 'first message' }); await contract.add_message({ text: 'second message' }); @@ -184,9 +184,9 @@ describe('contract without account', () => { jest.setTimeout(60000); beforeAll(async () => { - nearjs = await testUtils.setUpTestConnection(); - const contractId = testUtils.generateUniqueString('guestbook'); - await testUtils.deployContractGuestBook(nearjs.accountCreator.masterAccount, contractId); + nearjs = await setUpTestConnection(); + const contractId = generateUniqueString('guestbook'); + await deployContractGuestBook(nearjs.accountCreator.masterAccount, contractId); // @ts-expect-error test input contract = new Contract(nearjs.connection, contractId, { diff --git a/packages/accounts/test/lve_storage.test.ts b/packages/accounts/test/lve_storage.test.ts index 52c076a3c3..077ea78356 100644 --- a/packages/accounts/test/lve_storage.test.ts +++ b/packages/accounts/test/lve_storage.test.ts @@ -23,6 +23,7 @@ describe('Local View Execution - Storage', () => { test('load empty cached data', async () => { const storage = new Storage(); + // @ts-expect-error test input const data = storage.load({}); expect(data).toBe(undefined); diff --git a/packages/accounts/test/promise.test.ts b/packages/accounts/test/promise.test.ts index 1e8cfe91f5..85d27a5e67 100644 --- a/packages/accounts/test/promise.test.ts +++ b/packages/accounts/test/promise.test.ts @@ -1,26 +1,26 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test } from '@jest/globals'; -import testUtils from './test-utils'; +import { deployContract, generateUniqueString, setUpTestConnection } from './test-utils'; let nearjs; const CONTRACT_CALL_GAS = BigInt(300000000000000); beforeAll(async () => { - nearjs = await testUtils.setUpTestConnection(); + nearjs = await setUpTestConnection(); }); describe('with promises', () => { let contract, contract1, contract2; let oldLog; let logs; - const contractName = testUtils.generateUniqueString('cnt'); - const contractName1 = testUtils.generateUniqueString('cnt'); - const contractName2 = testUtils.generateUniqueString('cnt'); + const contractName = generateUniqueString('cnt'); + const contractName1 = generateUniqueString('cnt'); + const contractName2 = generateUniqueString('cnt'); beforeAll(async () => { - contract = await testUtils.deployContract(nearjs.accountCreator.masterAccount, contractName); - contract1 = await testUtils.deployContract(nearjs.accountCreator.masterAccount, contractName1); - contract2 = await testUtils.deployContract(nearjs.accountCreator.masterAccount, contractName2); + contract = await deployContract(nearjs.accountCreator.masterAccount, contractName); + contract1 = await deployContract(nearjs.accountCreator.masterAccount, contractName1); + contract2 = await deployContract(nearjs.accountCreator.masterAccount, contractName2); }); beforeEach(async () => { diff --git a/packages/accounts/test/test-utils.js b/packages/accounts/test/test-utils.js index 8134e1116f..ed730438e0 100644 --- a/packages/accounts/test/test-utils.js +++ b/packages/accounts/test/test-utils.js @@ -6,7 +6,7 @@ import path from 'path'; import { Account, AccountMultisig, Contract, Connection, LocalAccountCreator } from '../src'; import Config from './config'; -const networkId = 'unittest'; +export const networkId = 'unittest'; export const HELLO_WASM_PATH = process.env.HELLO_WASM_PATH || 'node_modules/near-hello/dist/main.wasm'; export const HELLO_WASM_BALANCE = BigInt('10000000000000000000000000'); diff --git a/packages/biometric-ed25519/test/utils.test.ts b/packages/biometric-ed25519/test/utils.test.ts index 08a0403690..dcd0354db6 100644 --- a/packages/biometric-ed25519/test/utils.test.ts +++ b/packages/biometric-ed25519/test/utils.test.ts @@ -32,9 +32,7 @@ global.PublicKeyCredential = PublicKeyCredentialMock; jest.mock('../lib/utils', () => { const originalModule = jest.requireActual('../lib/utils'); return { - // @ts-expect-error test input ...originalModule, - // @ts-expect-error test input convertUint8ArrayToArrayBuffer: jest.fn().mockImplementation(input => input.buffer), }; }); diff --git a/packages/crypto/package.json b/packages/crypto/package.json index db5739819a..14ac8b1032 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/keystores-browser/package.json b/packages/keystores-browser/package.json index e05802b6d2..5f2ad321de 100644 --- a/packages/keystores-browser/package.json +++ b/packages/keystores-browser/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/keystores-node/package.json b/packages/keystores-node/package.json index 9ffda6601b..72ed66762b 100644 --- a/packages/keystores-node/package.json +++ b/packages/keystores-node/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/keystores/package.json b/packages/keystores/package.json index f53ded2b42..c94e28cd73 100644 --- a/packages/keystores/package.json +++ b/packages/keystores/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/near-api-js/package.json b/packages/near-api-js/package.json index 520a06fa20..a0fb1a5b15 100644 --- a/packages/near-api-js/package.json +++ b/packages/near-api-js/package.json @@ -59,7 +59,7 @@ "compile": "tsc -p ./tsconfig.json", "dev": "pnpm compile -w", "build": "pnpm compile && pnpm bundle:all", - "test": "jest test --passWithNoTests", + "test": "jest --passWithNoTests", "lint": "concurrently \"pnpm:lint:*(!fix) --no-error-on-unmatched-pattern\"", "lint:src": "eslint --ext .ts src", "lint:fix": "concurrently \"pnpm:lint:*:fix\"", diff --git a/packages/providers/package.json b/packages/providers/package.json index 1132992076..07633b6a49 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/signers/package.json b/packages/signers/package.json index f68bc7af4c..4133ad9a52 100644 --- a/packages/signers/package.json +++ b/packages/signers/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/transactions/package.json b/packages/transactions/package.json index a333b5b6a3..a7cae436fe 100644 --- a/packages/transactions/package.json +++ b/packages/transactions/package.json @@ -9,7 +9,7 @@ "compile": "tsc -p tsconfig.json", "lint": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc", "lint:fix": "eslint -c ../../.eslintrc.ts.yml src/**/*.ts test/**/*.ts --no-eslintrc --fix", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/transactions/test/serialize.test.ts b/packages/transactions/test/serialize.test.ts index 4e227e49e4..d032e829aa 100644 --- a/packages/transactions/test/serialize.test.ts +++ b/packages/transactions/test/serialize.test.ts @@ -38,11 +38,9 @@ class Test { } test('serialize object', async () => { - // @ts-expect-error test input const value = new Test({ x: 255, y: 20, z: '123', q: [1, 2, 3] }); const schema = { struct: { x: 'u8', y: 'u16', z: 'string', q: { array: { type: 'u8' } } } }; const buf = serialize(schema, value); - // @ts-expect-error test input const new_value = new Test(deserialize(schema, buf)); // @ts-expect-error test input expect(new_value.x).toEqual(255); diff --git a/packages/utils/test/format.test.ts b/packages/utils/test/format.test.ts index 6adf10a78c..adceb7be26 100644 --- a/packages/utils/test/format.test.ts +++ b/packages/utils/test/format.test.ts @@ -26,7 +26,6 @@ test.each` ${'1000100000000000000000000000000'} | ${undefined} | ${'1,000,100'} ${'910000000000000000000000'} | ${0} | ${'1'} `('formatNearAmount($balance, $fracDigits) returns $expected', ({ balance, fracDigits, expected }) => { - // @ts-expect-error test input expect(formatNearAmount(balance, fracDigits)).toEqual(expected); }); diff --git a/packages/wallet-account/package.json b/packages/wallet-account/package.json index 601f014b8e..e41aface20 100644 --- a/packages/wallet-account/package.json +++ b/packages/wallet-account/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "pnpm compile", "compile": "tsc -p tsconfig.json", - "test": "jest test" + "test": "jest" }, "keywords": [], "author": "", diff --git a/packages/wallet-account/test/wallet_accounts.test.ts b/packages/wallet-account/test/wallet_accounts.test.ts index 6e078d95bb..0fd1ea9786 100644 --- a/packages/wallet-account/test/wallet_accounts.test.ts +++ b/packages/wallet-account/test/wallet_accounts.test.ts @@ -66,13 +66,11 @@ describe("Wallet account tests", () => { const windowValueBefore = global.window; beforeEach(() => { - // @ts-expect-error test input global.window = undefined; keyStore.clear(); }); afterEach(() => { - // @ts-expect-error test input global.window = windowValueBefore; });