1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

run unit tests in silent mode

* prevents unhelpful and noisy console logging in passed tests
This commit is contained in:
Matthias Kretschmann 2019-10-30 11:32:59 +01:00
parent 9daa49a085
commit ced3f716da
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 61 additions and 64 deletions

View File

@ -6,7 +6,7 @@
"scripts": {
"start": "react-scripts start",
"build": "CI=false react-scripts --max_old_space_size=4096 build",
"test": "react-scripts test --coverage --watchAll=false",
"test": "react-scripts test --coverage --watchAll=false --silent",
"test:watch": "react-scripts test --coverage",
"eject": "react-scripts eject",
"coverage": "cat coverage/lcov.info | codacy-coverage --token 8801f827fe1144ffa85cd7da94f2bbf7",

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, fireEvent, act, wait } from '@testing-library/react'
import { render, fireEvent, act } from '@testing-library/react'
import { MemoryRouter } from 'react-router'
import { createMemoryHistory, createLocation } from 'history'
import Faucet from '.'

View File

@ -1,19 +1,3 @@
/* eslint-disable no-console */
import '@testing-library/jest-dom/extend-expect'
// Filter out deprecation warnings caused by external dependencies
const originalWarning = console.warn
beforeAll(() => {
console.warn = (...args) => {
if (/Warning.*componentWillMount has been renamed/.test(args[0])) {
return
}
originalWarning.call(console, ...args)
}
})
afterAll(() => {
console.warn = originalWarning
})

View File

@ -514,9 +514,9 @@
}
},
"@types/jest": {
"version": "24.0.20",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.20.tgz",
"integrity": "sha512-M8ebEkOpykGdLoRrmew7UowTZ1DANeeP0HiSIChl/4DGgmnSC1ntitNtkyNSXjMTsZvXuaxJrxjImEnRWNPsPw==",
"version": "24.0.21",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.21.tgz",
"integrity": "sha512-uyqFvx78Tuy0h5iLCPWRCvi5HhWwEqhIj30doitp191oYLqlCxUyAJHdWVm5+Nr271/vPnkyt6rWeEIjGowBTg==",
"dev": true,
"requires": {
"@types/jest-diff": "*"
@ -544,9 +544,9 @@
}
},
"@types/node": {
"version": "12.11.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.7.tgz",
"integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA=="
"version": "12.12.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.0.tgz",
"integrity": "sha512-6N8Sa5AaENRtJnpKXZgvc119PKxT1Lk9VPy4kfT8JF23tIe1qDfaGkBR2DRKJFIA7NptMz+fps//C6aLi1Uoug=="
},
"@types/range-parser": {
"version": "1.2.3",
@ -555,9 +555,9 @@
"dev": true
},
"@types/request": {
"version": "2.48.2",
"resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.2.tgz",
"integrity": "sha512-gP+PSFXAXMrd5PcD7SqHeUjdGshAI8vKQ3+AvpQr3ht9iQea+59LOKvKITcQI+Lg+1EIkDP6AFSBUJPWG8GDyA==",
"version": "2.48.3",
"resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.3.tgz",
"integrity": "sha512-3Wo2jNYwqgXcIz/rrq18AdOZUQB8cQ34CXZo+LUwPJNpvRAL86+Kc2wwI8mqpz9Cr1V+enIox5v+WZhy/p3h8w==",
"requires": {
"@types/caseless": "*",
"@types/node": "*",
@ -1162,9 +1162,9 @@
}
},
"chokidar": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz",
"integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==",
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
"integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==",
"dev": true,
"requires": {
"anymatch": "^2.0.0",
@ -1656,9 +1656,9 @@
}
},
"dotenv": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz",
"integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA=="
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
},
"duplexer3": {
"version": "0.1.4",
@ -3228,9 +3228,9 @@
}
},
"is-retry-allowed": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz",
"integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz",
"integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==",
"dev": true
},
"is-stream": {
@ -3949,6 +3949,12 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash.memoize": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
"integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=",
"dev": true
},
"lodash.sortby": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
@ -4243,18 +4249,18 @@
}
},
"nodemon": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.1.tgz",
"integrity": "sha512-/DXLzd/GhiaDXXbGId5BzxP1GlsqtMGM9zTmkWrgXtSqjKmGSbLicM/oAy4FR0YWm14jCHRwnR31AHS2dYFHrg==",
"version": "1.19.4",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.4.tgz",
"integrity": "sha512-VGPaqQBNk193lrJFotBU8nvWZPqEZY2eIzymy2jjY0fJ9qIsxA0sxQ8ATPl0gZC645gijYEc1jtZvpS8QWzJGQ==",
"dev": true,
"requires": {
"chokidar": "^2.1.5",
"debug": "^3.1.0",
"chokidar": "^2.1.8",
"debug": "^3.2.6",
"ignore-by-default": "^1.0.1",
"minimatch": "^3.0.4",
"pstree.remy": "^1.1.6",
"semver": "^5.5.0",
"supports-color": "^5.2.0",
"pstree.remy": "^1.1.7",
"semver": "^5.7.1",
"supports-color": "^5.5.0",
"touch": "^3.1.0",
"undefsafe": "^2.0.2",
"update-notifier": "^2.5.0"
@ -4274,6 +4280,12 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
}
}
},
@ -5741,15 +5753,16 @@
"dev": true
},
"ts-jest": {
"version": "24.0.2",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz",
"integrity": "sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==",
"version": "24.1.0",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.1.0.tgz",
"integrity": "sha512-HEGfrIEAZKfu1pkaxB9au17b1d9b56YZSqz5eCVE8mX68+5reOvlM93xGOzzCREIov9mdH7JBG+s0UyNAqr0tQ==",
"dev": true,
"requires": {
"bs-logger": "0.x",
"buffer-from": "1.x",
"fast-json-stable-stringify": "2.x",
"json5": "2.x",
"lodash.memoize": "4.x",
"make-error": "1.x",
"mkdirp": "0.x",
"resolve": "1.x",
@ -5775,9 +5788,9 @@
}
},
"ts-node": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
"version": "8.4.1",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
"dev": true,
"requires": {
"arg": "^4.1.0",
@ -5928,9 +5941,9 @@
"dev": true
},
"upath": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz",
"integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
"integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==",
"dev": true
},
"update-notifier": {
@ -6249,9 +6262,9 @@
}
},
"yn": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true
}
}

View File

@ -8,7 +8,7 @@
"start": "nodemon --exec ts-node src/server.ts",
"serve": "node dist/src/server.js",
"build": "tsc",
"test": "jest --coverage",
"test": "jest --coverage --silent",
"test:watch": "jest --coverage --watch",
"coverage": "cat coverage/lcov.info | codacy-coverage --token 8801f827fe1144ffa85cd7da94f2bbf7"
},
@ -17,7 +17,7 @@
"body-parser": "^1.18.3",
"compression": "^1.7.4",
"debug": "^4.1.1",
"dotenv": "^8.1.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-validator": "^6.2.0",
"morgan": "^1.9.1",
@ -28,16 +28,16 @@
"@types/compression": "^1.0.1",
"@types/debug": "^4.1.5",
"@types/express": "^4.17.1",
"@types/jest": "^24.0.20",
"@types/jest": "^24.0.21",
"@types/morgan": "^1.7.37",
"@types/node": "^12.11.7",
"@types/request": "^2.48.2",
"@types/node": "^12.12.0",
"@types/request": "^2.48.3",
"@types/supertest": "^2.0.8",
"jest": "^24.9.0",
"nodemon": "^1.19.1",
"nodemon": "^1.19.4",
"supertest": "^4.0.2",
"ts-jest": "^24.0.2",
"ts-node": "^8.3.0",
"ts-jest": "^24.1.0",
"ts-node": "^8.4.1",
"typescript": "^3.6.4"
},
"repository": {