diff --git a/web3.js/package-lock.json b/web3.js/package-lock.json index 7da9470022..4c19194ab3 100644 --- a/web3.js/package-lock.json +++ b/web3.js/package-lock.json @@ -4206,6 +4206,12 @@ "@types/istanbul-lib-report": "*" } }, + "@types/json-schema": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.3.tgz", + "integrity": "sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -4257,6 +4263,39 @@ "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==", "dev": true }, + "@typescript-eslint/experimental-utils": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz", + "integrity": "sha512-zmpS6SyqG4ZF64ffaJ6uah6tWWWgZ8m+c54XXgwFtUv0jNz8aJAVx8chMCvnk7yl6xwn8d+d96+tWp7fXzTuDg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "1.13.0", + "eslint-scope": "^4.0.0" + }, + "dependencies": { + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + } + } + }, + "@typescript-eslint/typescript-estree": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz", + "integrity": "sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw==", + "dev": true, + "requires": { + "lodash.unescape": "4.0.1", + "semver": "5.5.0" + } + }, "JSONStream": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.4.tgz", @@ -7636,10 +7675,13 @@ } }, "eslint-plugin-jest": { - "version": "22.7.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.7.2.tgz", - "integrity": "sha512-Aecqe3ulBVI7amgOycVI8ZPL8o0SnGHOf3zn2/Ciu8TXyXDHcjtwD3hOs3ss/Qh/VAwlW/DMcuiXg5btgF+XMA==", - "dev": true + "version": "22.15.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.15.0.tgz", + "integrity": "sha512-hgnPbSqAIcLLS9ePb12hNHTRkXnkVaCfOwCt2pzQ8KpOKPWGA4HhLMaFN38NBa/0uvLfrZpcIRjT+6tMAfr58Q==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "^1.13.0" + } }, "eslint-plugin-prettier": { "version": "3.1.0", @@ -12990,6 +13032,12 @@ "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", "dev": true }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", + "dev": true + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", diff --git a/web3.js/package.json b/web3.js/package.json index ce4fc0cbde..3a88a5070b 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -103,7 +103,7 @@ "eslint": "6.1.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-import": "2.18.2", - "eslint-plugin-jest": "22.7.2", + "eslint-plugin-jest": "22.15.0", "eslint-plugin-prettier": "^3.0.0", "flow-bin": "0.104.0", "flow-typed": "2.6.1", diff --git a/web3.js/src/connection.js b/web3.js/src/connection.js index 44e7b52f88..fa811e252e 100644 --- a/web3.js/src/connection.js +++ b/web3.js/src/connection.js @@ -540,7 +540,7 @@ export class Connection { return res.result; } - /** + /** * Fetch the current slot that the node is processing */ async getSlot(): Promise { @@ -553,7 +553,6 @@ export class Connection { return res.result; } - /** * Fetch the current slot leader of the cluster */ diff --git a/web3.js/test/connection.test.js b/web3.js/test/connection.test.js index 1fde8094e4..e4e810871b 100644 --- a/web3.js/test/connection.test.js +++ b/web3.js/test/connection.test.js @@ -39,7 +39,7 @@ test('get account info - error', () => { errorResponse, ]); - expect(connection.getAccountInfo(account.publicKey)).rejects.toThrow( + return expect(connection.getAccountInfo(account.publicKey)).rejects.toThrow( errorMessage, ); }); @@ -152,7 +152,6 @@ test('get slot', async () => { } }); - test('get slot leader', async () => { const connection = new Connection(url); @@ -222,7 +221,7 @@ test('getEpochVoteAccounts', async () => { expect(voteAccounts.length).toBeGreaterThan(0); }); -test('confirm transaction - error', () => { +test('confirm transaction - error', async () => { const connection = new Connection(url); const badTransactionSignature = 'bad transaction signature'; @@ -236,7 +235,7 @@ test('confirm transaction - error', () => { errorResponse, ]); - expect( + await expect( connection.confirmTransaction(badTransactionSignature), ).rejects.toThrow(errorMessage); @@ -249,7 +248,7 @@ test('confirm transaction - error', () => { errorResponse, ]); - expect( + await expect( connection.getSignatureStatus(badTransactionSignature), ).rejects.toThrow(errorMessage); });