From 3c329bee05239403061babc8bb383c25ec25d967 Mon Sep 17 00:00:00 2001 From: Lian Li Date: Fri, 12 Oct 2018 09:47:06 -0700 Subject: [PATCH] readline: assert without the use of event listener PR-URL: https://github.com/nodejs/node/pull/23472 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Shelley Vohr Reviewed-By: Trivikram Kamat --- .../parallel/test-readline-emit-keypress-events.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-readline-emit-keypress-events.js b/test/parallel/test-readline-emit-keypress-events.js index ddadf6d223feaf..3b9aece4654ac1 100644 --- a/test/parallel/test-readline-emit-keypress-events.js +++ b/test/parallel/test-readline-emit-keypress-events.js @@ -20,11 +20,9 @@ stream.on('keypress', (s, k) => { stream.write('foo'); -process.on('exit', () => { - assert.deepStrictEqual(sequence, ['f', 'o', 'o']); - assert.deepStrictEqual(keys, [ - { sequence: 'f', name: 'f', ctrl: false, meta: false, shift: false }, - { sequence: 'o', name: 'o', ctrl: false, meta: false, shift: false }, - { sequence: 'o', name: 'o', ctrl: false, meta: false, shift: false } - ]); -}); +assert.deepStrictEqual(sequence, ['f', 'o', 'o']); +assert.deepStrictEqual(keys, [ + { sequence: 'f', name: 'f', ctrl: false, meta: false, shift: false }, + { sequence: 'o', name: 'o', ctrl: false, meta: false, shift: false }, + { sequence: 'o', name: 'o', ctrl: false, meta: false, shift: false } +]);