git.delta.rocks / unique-network / refs/commits / 2edaa6b5fc94

difftreelog

Remove fs dependency from tests

Greg Zaitsev2020-12-11parent: #3c67ef3.patch.diff
in: master

3 files changed

modifiedtests/package-lock.jsondiffbeforeafterboth
--- a/tests/package-lock.json
+++ b/tests/package-lock.json
@@ -14,8 +14,7 @@
         "@polkadot/types": "^2.3.1",
         "@polkadot/util": "^3.4.1",
         "@types/bn.js": "^4.11.6",
-        "chai-as-promised": "^7.1.1",
-        "fs": "^0.0.1-security"
+        "chai-as-promised": "^7.1.1"
       },
       "devDependencies": {
         "@polkadot/dev": "^0.52.11",
@@ -13026,11 +13025,6 @@
         "safe-buffer": "~5.1.0"
       }
     },
-    "node_modules/fs": {
-      "version": "0.0.1-security",
-      "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
-      "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ="
-    },
     "node_modules/fs-extra": {
       "version": "9.0.1",
       "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz",
@@ -39964,11 +39958,6 @@
           }
         }
       }
-    },
-    "fs": {
-      "version": "0.0.1-security",
-      "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
-      "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ="
     },
     "fs-extra": {
       "version": "9.0.1",
modifiedtests/package.jsondiffbeforeafterboth
before · tests/package.json
1{2  "name": "NftTests",3  "version": "1.0.0",4  "description": "Substrate Nft tests",5  "main": "",6  "devDependencies": {7    "@polkadot/dev": "^0.52.11",8    "@polkadot/ts": "^0.3.41",9    "@types/bn.js": "^4.11.6",10    "@types/chai": "^4.2.12",11    "@types/chai-as-promised": "^7.1.3",12    "@types/mocha": "^8.0.3",13    "chai": "^4.2.0",14    "mocha": "^8.1.1",15    "ts-node": "^9.0.0",16    "tslint": "^5.20.1",17    "typescript": "^3.9.7"18  },19  "scripts": {20    "test": "mocha --timeout 9999999 -r ts-node/register ./**/*.test.ts"21  },22  "author": "",23  "license": "Apache 2.0",24  "homepage": "",25  "dependencies": {26    "@polkadot/api": "^2.3.1",27    "@polkadot/api-contract": "^2.3.1",28    "@polkadot/types": "^2.3.1",29    "@polkadot/util": "^3.4.1",30    "@types/bn.js": "^4.11.6",31    "chai-as-promised": "^7.1.1",32    "fs": "^0.0.1-security"33  },34  "standard": {35    "globals": [36      "it",37      "assert",38      "beforeEach",39      "afterEach",40      "describe",41      "contract",42      "artifacts"43    ]44  }45}
modifiedtests/src/substrate/substrate-api.tsdiffbeforeafterboth
--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -2,9 +2,7 @@
 import config from "../config";
 import promisifySubstrate from "./promisify-substrate";
 import { ApiOptions } from "@polkadot/api/types";
-import fs from "fs";
-
-const rtt = JSON.parse(fs.readFileSync('../runtime_types.json', 'utf8'));
+import rtt from "../../../runtime_types.json";
 
 function defaultApiOptions(): ApiOptions {
   const wsProvider = new WsProvider(config.substrateUrl);