From 29ceca49cfa0a0610cc7f26cdf2782ccd8edf169 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 21 Nov 2019 13:18:37 +0100 Subject: [PATCH] test(mixin): improve object test to ensure proper object assign order (#745) --- test/mixin.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/mixin.test.js b/test/mixin.test.js index 49bcfa94f..057d766e9 100644 --- a/test/mixin.test.js +++ b/test/mixin.test.js @@ -76,15 +76,14 @@ test('mixin object is not called if below log level', async ({ ok }) => { }) test('mixin object + logged object', async ({ ok, same }) => { - let n = 0 const stream = sink() const instance = pino({ mixin () { - return { hello: ++n } + return { foo: 1, bar: 2 } } }, stream) instance.level = name - instance[name]({ foo: 42 }) + instance[name]({ bar: 3, baz: 4 }) const result = await once(stream, 'data') ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()') delete result.time @@ -92,8 +91,9 @@ test('mixin object + logged object', async ({ ok, same }) => { pid, hostname, level, - foo: 42, - hello: 1, + foo: 1, + bar: 3, + baz: 4, v: 1 }) })