@defra/bng-utils-lib 0.273.8 → 0.273.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/bng-utils-lib",
3
- "version": "0.273.8",
3
+ "version": "0.273.10",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A library of utilities for the Biodiversity Net Gain Service",
@@ -14,9 +14,9 @@
14
14
  "license": "OGL-UK-3.0",
15
15
  "dependencies": {
16
16
  "@azure/identity": "^4.0.0",
17
- "@defra/bng-connectors-lib": "^0.273.8",
17
+ "@defra/bng-connectors-lib": "^0.273.10",
18
18
  "axios": "^1.6.2",
19
- "pino": "^8.17.2"
19
+ "pino-pretty": "10.3.1"
20
20
  },
21
- "gitHead": "ab7ff15bdc62dcbe6e3a0da40560bc7e27c8b03f"
21
+ "gitHead": "492925c3ce0091426d955d3fb64901cb6364fb66"
22
22
  }
@@ -0,0 +1,13 @@
1
+ import logger from '../logger.js'
2
+
3
+ // Adapted from https://stackoverflow.com/questions/44890836/how-to-test-console-log-output-using-jest-or-other-javascript-testing-framework
4
+ describe('The logger', () => {
5
+ it('should log output', async () => {
6
+ const mockLogText = 'mock log text'
7
+ const loggedData = []
8
+ const storeLogOutput = input => loggedData.push(input)
9
+ logger.info = jest.fn(storeLogOutput)
10
+ logger.info(mockLogText)
11
+ expect(loggedData).toContain(mockLogText)
12
+ })
13
+ })
@@ -9,4 +9,13 @@ const loggerOptions = {
9
9
  }
10
10
  }
11
11
 
12
+ if (process.env.NODE_ENV === 'development') {
13
+ loggerOptions.options.transport = {
14
+ target: 'pino-pretty',
15
+ options: {
16
+ colorize: true
17
+ }
18
+ }
19
+ }
20
+
12
21
  export default loggerOptions