Feat/guard clause #31
Errors 29
Found 29 errors
Annotations
Check failure on line 22 in packages/logger/src/logger.configuration.ts
github-actions / TypeCheck
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'typeof Severity'.
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'typeof Severity'.
No index signature with a parameter of type 'string' was found on type 'typeof Severity'.
Raw output
20 |
21 | if (process.env.LOG_LEVEL) {
> 22 | this.severity = Severity[process.env.LOG_LEVEL] || Severity.INFO
| ^
23 | } else {
24 | this.severity = Severity.INFO
25 | }
Check failure on line 8 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Raw output
6 | import { configuration } from './logger.configuration'
7 |
> 8 | describe('logger', () => {
| ^
9 | afterEach(() => {
10 | jest.clearAllMocks()
11 | })
Check failure on line 9 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'afterEach'.
Cannot find name 'afterEach'.
Raw output
7 |
8 | describe('logger', () => {
> 9 | afterEach(() => {
| ^
10 | jest.clearAllMocks()
11 | })
12 |
Check failure on line 10 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'jest'.
Cannot find name 'jest'.
Raw output
8 | describe('logger', () => {
9 | afterEach(() => {
> 10 | jest.clearAllMocks()
| ^
11 | })
12 |
13 | it('log body', () => {
Check failure on line 13 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Raw output
11 | })
12 |
> 13 | it('log body', () => {
| ^
14 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
15 |
16 | new Logger().info('test')
Check failure on line 14 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'jest'.
Cannot find name 'jest'.
Raw output
12 |
13 | it('log body', () => {
> 14 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
| ^
15 |
16 | new Logger().info('test')
17 |
Check failure on line 18 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
16 | new Logger().info('test')
17 |
> 18 | expect(log).toHaveBeenCalledWith(expect.objectContaining({ body: 'test' }))
| ^
19 | })
20 |
21 | it('log attributes', () => {
Check failure on line 18 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
16 | new Logger().info('test')
17 |
> 18 | expect(log).toHaveBeenCalledWith(expect.objectContaining({ body: 'test' }))
| ^
19 | })
20 |
21 | it('log attributes', () => {
Check failure on line 21 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Raw output
19 | })
20 |
> 21 | it('log attributes', () => {
| ^
22 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
23 |
24 | new Logger().info('test', { attr: 'test' })
Check failure on line 22 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'jest'.
Cannot find name 'jest'.
Raw output
20 |
21 | it('log attributes', () => {
> 22 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
| ^
23 |
24 | new Logger().info('test', { attr: 'test' })
25 |
Check failure on line 26 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
24 | new Logger().info('test', { attr: 'test' })
25 |
> 26 | expect(log).toHaveBeenCalledWith(
| ^
27 | expect.objectContaining({ body: 'test', attributes: { attr: 'test' } })
28 | )
29 | })
Check failure on line 27 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
25 |
26 | expect(log).toHaveBeenCalledWith(
> 27 | expect.objectContaining({ body: 'test', attributes: { attr: 'test' } })
| ^
28 | )
29 | })
30 |
Check failure on line 31 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Raw output
29 | })
30 |
> 31 | it('log name', () => {
| ^
32 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
33 |
34 | new Logger('test').info('test')
Check failure on line 32 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'jest'.
Cannot find name 'jest'.
Raw output
30 |
31 | it('log name', () => {
> 32 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
| ^
33 |
34 | new Logger('test').info('test')
35 |
Check failure on line 36 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
34 | new Logger('test').info('test')
35 |
> 36 | expect(log).toHaveBeenCalledWith(expect.objectContaining({ name: 'test' }))
| ^
37 | })
38 |
39 | it('log child name', () => {
Check failure on line 36 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
34 | new Logger('test').info('test')
35 |
> 36 | expect(log).toHaveBeenCalledWith(expect.objectContaining({ name: 'test' }))
| ^
37 | })
38 |
39 | it('log child name', () => {
Check failure on line 39 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Raw output
37 | })
38 |
> 39 | it('log child name', () => {
| ^
40 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
41 |
42 | new Logger('parent').child('child').info('test')
Check failure on line 40 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'jest'.
Cannot find name 'jest'.
Raw output
38 |
39 | it('log child name', () => {
> 40 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
| ^
41 |
42 | new Logger('parent').child('child').info('test')
43 |
Check failure on line 44 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
42 | new Logger('parent').child('child').info('test')
43 |
> 44 | expect(log).toHaveBeenCalledWith(expect.objectContaining({ name: 'parent:child' }))
| ^
45 | })
46 |
47 | it('log child attributes', () => {
Check failure on line 44 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
42 | new Logger('parent').child('child').info('test')
43 |
> 44 | expect(log).toHaveBeenCalledWith(expect.objectContaining({ name: 'parent:child' }))
| ^
45 | })
46 |
47 | it('log child attributes', () => {
Check failure on line 47 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Raw output
45 | })
46 |
> 47 | it('log child attributes', () => {
| ^
48 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
49 |
50 | new Logger('parent', { parent: true }).child('child', { child: true }).info('test')
Check failure on line 48 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'jest'.
Cannot find name 'jest'.
Raw output
46 |
47 | it('log child attributes', () => {
> 48 | const log = jest.spyOn(configuration.transport, 'info').mockImplementation(() => undefined)
| ^
49 |
50 | new Logger('parent', { parent: true }).child('child', { child: true }).info('test')
51 |
Check failure on line 52 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
50 | new Logger('parent', { parent: true }).child('child', { child: true }).info('test')
51 |
> 52 | expect(log).toHaveBeenCalledWith(
| ^
53 | expect.objectContaining({ attributes: { parent: true, child: true } })
54 | )
55 | })
Check failure on line 53 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'expect'.
Cannot find name 'expect'.
Raw output
51 |
52 | expect(log).toHaveBeenCalledWith(
> 53 | expect.objectContaining({ attributes: { parent: true, child: true } })
| ^
54 | )
55 | })
56 |
Check failure on line 57 in packages/logger/src/logger.test.ts
github-actions / TypeCheck
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
Raw output
55 | })
56 |
> 57 | it('log debug enabled', () => {
| ^
58 | configuration.setDebug('debug')
59 |
60 | const log = jest.spyOn(configuration.transport, 'debug').mockImplementation(() => undefined)