https://netsuiteprofessionals.com logo
#suitescript
Title
# suitescript
m

mkachline

04/28/2022, 5:49 PM
Hey all, does anyone have a recommended set of tools or best practices for test automation of SuiteScript 2.x "Server Side" scripts? Primarily, we are looking to create and run test automation for one or all of: libraries, UserEvents and MapReduce scripts.
s

Shawn Talbert

04/28/2022, 5:59 PM
NS has some rudimentary examples. Maybe @battk knows a link for you
If you're using NFT, writing unit tests is for scripts manipulating records is easier since you can use basic object stubs for testing rather than mocking tons of NS record apis.
If not, be prepared to have fun with your mocking library of choice.
I'm talking about unit testing above (i.e. mocking out all dependencies)
m

mkachline

04/28/2022, 6:03 PM
Dumb question, what is "NFT" in this context? I only know NFT as Non-fungible tokens. We are using visual studio as our IDE.
s

Shawn Talbert

04/28/2022, 6:03 PM
for integration or E2E testing it's a different story
m

mkachline

04/28/2022, 6:04 PM
We're more concerned with functional testing.
s

Shawn Talbert

04/28/2022, 6:05 PM
'functional' is ambiguous, unless you mean higher level functionality (aka integration/e2e)
m

mkachline

04/28/2022, 6:07 PM
Wow, thanks for the pointer on NFT! I was not aware of that. In regards to 'functional testing', to clarify, we have quite a number of SS 2.x library calls which we'd like a test suite for. So, a test tool which can easily mock data and test each of those functions would be a fantastic starting point.
s

Shawn Talbert

04/28/2022, 6:08 PM
What NS uses for their example (and so do we, predating NS's examples 🙂 ) is
jest
m

mkachline

04/28/2022, 6:09 PM
👍 I'll check that out, and, NS's examples. Apologies for the apparent need to rtfm.
Thank you so much for the suggestions, @Shawn Talbert