Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for console.log() in CI (#1156)
* Check for console.log() in CI DEFRA/water-abstraction-team#94 During development, we constantly use `console.log()` to print out and check for expected results. Although they are useful during the development process, it is very common that we forget to remove them, leading to requested changes during pull requests 😪. Currently, we use checks within our CI to catch mistakes similar to this such as `.only()` on `describe` and `it` blocks within our unit tests. ```yaml # Before we do anything, check we haven't accidentally left any `describe.only()` or `it.only(` statements in the # tests # # Reworking of https://stackoverflow.com/a/21788642/6117745 - name: Temporary tag check run: | ! grep -R 'describe.only(\|it.only(' test ``` Aside from the accidental `console.log()` present, there is one instance we do not want the CI to flag. Within `app/server.js` there is a `console.log()` that is there to log unhandled exceptions. In this case we can change it to 'console.error()' to get around this. This PR is focused on implementing the checks for `console.log()` when pushing code and changing the `console.log()` within `app/server.js` to `console.error()`.
- Loading branch information