netsuite-suitecloud-sdk icon indicating copy to clipboard operation
netsuite-suitecloud-sdk copied to clipboard

unit testing fails when `define` has been proxied/ abstracted, etc

Open gillyspy opened this issue 3 years ago • 2 comments

Your environment

OS : macOS 12 Node.js version : 16.13.2 suitecloud-cli version : 1.3.1 Terminal/CMD tool : iTerm

Describe the bug

unit testing module does not support a customized define

To Reproduce

Steps to reproduce the behavior:

  1. create a module like this:
const x = define;
x([], ()=>{
}); 
  1. test with suitecloud

Actual Behavior

ReferenceError: define is not defined

Expected Behavior

that should work. While this is a contrived example it's based on something real. we have define conditionally wrapped in node because we were doing unit testing in the past (before suitecloud solution) came along and needed a way to test them

Additional context

how are you executing this if define does not exist?

gillyspy avatar Jan 31 '22 03:01 gillyspy

i opened this issue for you guys. Can you try it? or how can i try it with your package?

gillyspy avatar Feb 03 '22 19:02 gillyspy

Hi @gillyspy , Thanks for reporting this. We will investigate this when we can and get back to you.

tourajvaziri avatar Oct 07 '22 17:10 tourajvaziri