Skip to content

Commit

Permalink
refactor: remove final uses of logandthrow
Browse files Browse the repository at this point in the history
  • Loading branch information
drazisil-codecov committed Aug 13, 2021
1 parent 91d1dc8 commit 825b71d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
14 changes: 14 additions & 0 deletions foo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[2021-08-13T17:36:22.167Z] ['info']
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/

Codecov report uploader 0.1.0
[2021-08-13T17:36:22.168Z] ['info'] => Project root located at: /Users/drazisil-codecov/Downloads
[2021-08-13T17:36:22.168Z] ['info'] -> No token specified or token is empty
[2021-08-13T17:36:22.168Z] ['verbose'] Start of network processing...
[2021-08-13T17:36:22.168Z] ['verbose'] Searching for files in /Users/drazisil-codecov/Downloads
[2021-08-13T17:36:22.178Z] ['info'] Searching for coverage files...
11 changes: 0 additions & 11 deletions src/helpers/util.ts

This file was deleted.

5 changes: 2 additions & 3 deletions test/test_helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const td = require('testdouble')
const childProcess = require('child_process')
const { beforeAll, afterEach, afterAll, expect } = require('@jest/globals')
const { logAndThrow } = require('../src/helpers/util')

// eslint-disable-next-line no-undef
require('testdouble-jest')(td, jest)
Expand All @@ -17,12 +16,12 @@ let exec

beforeAll(() => {
execSync = jest.spyOn(childProcess, 'execSync').mockImplementation(() => {
logAndThrow(
throw new Error(
`Security alert! Do not use execSync(), use spawnSync() instead`,
)
})
exec = jest.spyOn(childProcess, 'exec').mockImplementation(() => {
logAndThrow(`Security alert! Do not use exec(), use spawn() instead`)
throw new Error(`Security alert! Do not use exec(), use spawn() instead`)
})
})

Expand Down

0 comments on commit 825b71d

Please sign in to comment.