From f06944dc1db06752cd23b327327197f4b3a44b9e Mon Sep 17 00:00:00 2001 From: Duncan Beevers Date: Thu, 16 Dec 2021 08:01:34 -0800 Subject: [PATCH] fixup! [Tests] Component util isReactHookCall Self-test the testComponentsDetect function to ensure Program:exit instruction is augmented with visit-logging behavior --- tests/util/Components.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/util/Components.js b/tests/util/Components.js index 6d45417932..694168fb6f 100644 --- a/tests/util/Components.js +++ b/tests/util/Components.js @@ -286,5 +286,17 @@ describe('Components', () => { }); }); }); + + describe('testComponentsDetect', () => { + it('should log Program:exit instruction', () => { + testComponentsDetect({ + code: '', + }, { + 'Program:exit': () => true, + }, (_components, instructionResults) => { + assert.deepEqual(instructionResults, [{ type: 'Program:exit', result: true }]); + }); + }); + }); }); });