Skip to content

Commit d0ae957

Browse files
Merge branch 'pinojs:main' into feat/wait-for
2 parents ab5d8e0 + 2039e78 commit d0ae957

File tree

7 files changed

+41
-47
lines changed

7 files changed

+41
-47
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict'
2+
3+
module.exports = require('neostandard')({
4+
ignores: require('neostandard').resolveIgnoresFromGitignore(),
5+
ts: true
6+
})

package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,14 @@
3535
"split2": "^4.2.0"
3636
},
3737
"devDependencies": {
38-
"@fastify/pre-commit": "^2.1.0",
39-
"@types/node": "^20.11.25",
40-
"eslint": "^8.57.0",
41-
"eslint-config-standard": "^17.1.0",
42-
"eslint-plugin-import": "^2.29.1",
43-
"eslint-plugin-n": "^16.6.2",
44-
"eslint-plugin-node": "^11.1.0",
45-
"eslint-plugin-promise": "^6.1.1",
46-
"pino": "^8.19.0",
38+
"@fastify/pre-commit": "^2.2.0",
39+
"@types/node": "^22.13.5",
40+
"eslint": "^9.21.0",
41+
"neostandard": "^0.12.1",
42+
"pino": "^9.6.0",
4743
"ts-node": "^10.9.2",
48-
"tsd": "^0.30.7",
49-
"typescript": "^5.4.2"
44+
"tsd": "^0.31.2",
45+
"typescript": "^5.7.3"
5046
},
5147
"tsd": {
5248
"directory": "test/types"

pino-test.d.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { deepStrictEqual } from "assert";
2-
import type { Transform } from "stream";
1+
import type { deepStrictEqual } from 'assert'
2+
import type { Transform } from 'stream'
33

44
/**
55
* Create a Pino destination stream to easily inspect the logs processed by Pino.
@@ -10,7 +10,7 @@ import type { Transform } from "stream";
1010
*
1111
* @returns A stream.
1212
*/
13-
declare function sink({ destroyOnError, emitErrorEvent }?: { destroyOnError?: boolean, emitErrorEvent?: boolean }): Transform
13+
declare function sink ({ destroyOnError, emitErrorEvent }?: { destroyOnError?: boolean, emitErrorEvent?: boolean }): Transform
1414

1515
/**
1616
* Assert that a single log is expected.
@@ -26,19 +26,19 @@ declare function sink({ destroyOnError, emitErrorEvent }?: { destroyOnError?: bo
2626
* @example
2727
* const stream = pinoTest.sink()
2828
* const logger = pino(stream)
29-
*
29+
*
3030
* logger.info('hello world')
31-
*
31+
*
3232
* const expected = { msg: 'hello world', level: 30 }
3333
* await pinoTest.once(stream, expected)
34-
*
34+
*
3535
* logger.info('hello world 1')
36-
*
36+
*
3737
* await pinoTest.once(stream, (log) => {
3838
* assert.strictEqual(log.msg, 'hello world 1')
3939
* })
4040
*/
41-
declare function once(stream: Transform, expectedOrCallback: object | Function, assert?: typeof deepStrictEqual): Promise<void>
41+
declare function once (stream: Transform, expectedOrCallback: object | Function, assert?: typeof deepStrictEqual): Promise<void>
4242

4343
/**
4444
* Assert that consecutive logs are expected.
@@ -54,16 +54,16 @@ declare function once(stream: Transform, expectedOrCallback: object | Function,
5454
* @example
5555
* const stream = pinoTest.sink()
5656
* const logger = pino(stream)
57-
*
57+
*
5858
* logger.info('hello world')
5959
* logger.info('hi world')
60-
*
60+
*
6161
* const expecteds = [
6262
* { msg: 'hello world', level: 30 },
6363
* (log) => assert.strictEqual(log.msg, 'hi world')
6464
* ]
6565
* await pinoTest.consecutive(stream, expecteds)
6666
*/
67-
declare function consecutive(stream: Transform, expectedsOrCallbacks: Array<object | Function>, assert?: typeof deepStrictEqual): Promise<void>
67+
declare function consecutive (stream: Transform, expectedsOrCallbacks: Array<object | Function>, assert?: typeof deepStrictEqual): Promise<void>
6868

69-
export { consecutive, once, sink };
69+
export { consecutive, once, sink }

test/types/pino-test.test-d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Transform } from 'node:stream';
2-
import { expectError, expectType } from 'tsd';
3-
import pinoTest from '../../pino-test';
1+
import { Transform } from 'node:stream'
2+
import { expectError, expectType } from 'tsd'
3+
import pinoTest from '../../pino-test'
44

55
const stream = pinoTest.sink()
66

@@ -22,4 +22,4 @@ expectType<Promise<void>>(pinoTest.once(stream, { msg: '', level: 30 }))
2222
expectType<Promise<void>>(pinoTest.once(stream, (received: any) => received.msg === 'hello world'))
2323

2424
expectType<Promise<void>>(pinoTest.consecutive(stream, [{ msg: '', level: 30 }]))
25-
expectType<Promise<void>>(pinoTest.consecutive(stream, [{ msg: '', level: 30 }, (received: any) => received.msg === 'hi world']))
25+
expectType<Promise<void>>(pinoTest.consecutive(stream, [{ msg: '', level: 30 }, (received: any) => received.msg === 'hi world']))

test/types/pino-test.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import pino from 'pino';
2-
import pinoTest from '../../pino-test';
1+
/* eslint-disable */
2+
3+
import pino from 'pino'
4+
import pinoTest from '../../pino-test'
35

46
const stream = pinoTest.sink()
57
const logger = pino(stream)
@@ -8,17 +10,17 @@ logger.info('hello world')
810
logger.info('by world')
911

1012
async function onceType() {
11-
const expected = { msg: 'hello world', level: 30 }
12-
await pinoTest.once(stream, expected)
13-
await pinoTest.once(stream, (received: any) => received.msg === 'hello world')
13+
const expected = { msg: 'hello world', level: 30 }
14+
await pinoTest.once(stream, expected)
15+
await pinoTest.once(stream, (received: any) => received.msg === 'hello world')
1416
}
1517

1618
async function consecutiveType() {
17-
const expected = [
18-
{ msg: 'hello world', level: 30 },
19-
(received: any) => received.msg === 'hi world'
20-
]
21-
await pinoTest.consecutive(stream, expected)
19+
const expected = [
20+
{ msg: 'hello world', level: 30 },
21+
(received: any) => received.msg === 'hi world'
22+
]
23+
await pinoTest.consecutive(stream, expected)
2224
}
2325

2426
const stream1 = pinoTest.sink({ emitErrorEvent: true })

0 commit comments

Comments
 (0)