Browse Source

(Tests) Add TS configs

addTSTests
junderw 6 years ago
parent
commit
8e3cc48f9a
No known key found for this signature in database GPG Key ID: B256185D3A971908
  1. 25
      package-lock.json
  2. 12
      package.json
  3. 36
      tsconfig-test.json
  4. 12
      tsconfig.json
  5. 39
      tslint-test.json

25
package-lock.json

@ -236,16 +236,23 @@
}
},
"bip39": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/bip39/-/bip39-2.5.0.tgz",
"integrity": "sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA==",
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.1.tgz",
"integrity": "sha512-h1mxBCpocHoZ6eUWNwh13bSXCZYy/wknSAvs1se3XDOTeerHU3jA8E4PIoPr8YMY3kdDSCpM1HypJmDS+C7U2Q==",
"dev": true,
"requires": {
"@types/node": "11.11.6",
"create-hash": "^1.1.0",
"pbkdf2": "^3.0.9",
"randombytes": "^2.0.1",
"safe-buffer": "^5.0.1",
"unorm": "^1.3.3"
"randombytes": "^2.0.1"
},
"dependencies": {
"@types/node": {
"version": "11.11.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz",
"integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==",
"dev": true
}
}
},
"bip65": {
@ -1981,12 +1988,6 @@
"integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==",
"dev": true
},
"unorm": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.5.0.tgz",
"integrity": "sha512-sMfSWoiRaXXeDZSXC+YRZ23H4xchQpwxjpw1tmfR+kgbBCaOgln4NI0LXejJIhnBuKINrB3WRn+ZI8IWssirVw==",
"dev": true
},
"varuint-bitcoin": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.0.tgz",

12
package.json

@ -15,7 +15,9 @@
"bitcoinjs"
],
"scripts": {
"build": "tsc -p ./tsconfig.json",
"build": "npm run build-src && npm run build-test",
"build-src": "tsc -p ./tsconfig.json",
"build-test": "tsc -p ./tsconfig-test.json",
"coverage-report": "npm run build && npm run nobuild:coverage-report",
"coverage-html": "npm run build && npm run nobuild:coverage-html",
"coverage": "npm run build && npm run nobuild:coverage",
@ -23,13 +25,15 @@
"format:ci": "npm run prettier -- --check",
"gitdiff:ci": "npm run build && git diff --exit-code",
"integration": "npm run build && npm run nobuild:integration",
"lint": "tslint -p tsconfig.json -c tslint.json",
"lint": "npm run lint-src && npm run lint-test",
"lint-src": "tslint -p tsconfig.json -c tslint.json",
"lint-test": "tslint -p tsconfig-test.json -c tslint-test.json",
"nobuild:coverage-report": "nyc report --reporter=lcov",
"nobuild:coverage-html": "nyc report --reporter=html",
"nobuild:coverage": "nyc --check-coverage --branches 90 --functions 90 --lines 90 mocha",
"nobuild:integration": "mocha --timeout 50000 test/integration/",
"nobuild:unit": "mocha",
"prettier": "prettier 'ts_src/**/*.ts' --ignore-path ./.prettierignore",
"prettier": "prettier '{ts_src,ts_test}/**/*.ts' --ignore-path ./.prettierignore",
"test": "npm run build && npm run format:ci && npm run lint && npm run nobuild:coverage",
"unit": "npm run build && npm run nobuild:unit"
},
@ -59,7 +63,7 @@
"wif": "^2.0.1"
},
"devDependencies": {
"bip39": "^2.3.0",
"bip39": "^3.0.1",
"bip65": "^1.0.1",
"bip68": "^1.0.3",
"bn.js": "^4.11.8",

36
tsconfig-test.json

@ -0,0 +1,36 @@
{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"outDir": "./test",
"declaration": false,
"rootDir": "./ts_test",
"types": [
"node"
],
"lib": [
"es2018",
"dom"
],
"allowJs": false,
"strict": false,
"noImplicitAny": false,
"strictNullChecks": false,
"strictFunctionTypes": false,
"strictBindCallApply": false,
"strictPropertyInitialization": false,
"noImplicitThis": false,
"alwaysStrict": false,
"esModuleInterop": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"resolveJsonModule": true
},
"include": [
"ts_test/**/*.ts"
],
"exclude": [
"**/*.spec.ts",
"node_modules/**/*"
]
}

12
tsconfig.json

@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2015",
"target": "ES2017",
"module": "commonjs",
"outDir": "./src",
"declaration": true,
@ -9,6 +9,10 @@
"types": [
"node"
],
"lib": [
"es2018",
"dom"
],
"allowJs": false,
"strict": true,
"noImplicitAny": true,
@ -23,10 +27,10 @@
"noUnusedParameters": true
},
"include": [
"ts_src/**/*.ts"
"ts_src/**/*.ts"
],
"exclude": [
"**/*.spec.ts",
"node_modules/**/*"
"**/*.spec.ts",
"node_modules/**/*"
]
}

39
tslint-test.json

@ -0,0 +1,39 @@
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"rules": {
"arrow-parens": [true, "ban-single-arg-parens"],
"curly": false,
"indent": [
true,
"spaces",
2
],
"interface-name": [false],
"match-default-export-name": true,
"max-classes-per-file": [false],
"member-access": [true, "no-public"],
"no-bitwise": false,
"no-console": false,
"no-empty": [true, "allow-empty-catch"],
"no-return-await": true,
"no-var-requires": false,
"no-unused-expression": false,
"object-literal-sort-keys": false,
"quotemark": [true, "single"],
"typedef": [
true,
"call-signature",
"arrow-call-signature",
"property-declaration"
],
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
]
},
"rulesDirectory": []
}
Loading…
Cancel
Save