Hello , Does anyone have any info on tools, technologies, frameworks, best practices that can be used to for unit testing, code coverage and CI for NetSuite development
s
Sandii
06/11/2020, 7:12 PM
It's difficult, there are some companies out there that have built unit testing frameworks out. Just google unit testing and NS, you will find a couple.
Xcelero, Assertology, and ES Unit are the ones I've heard of (never used any of them)
c
creece
06/11/2020, 7:15 PM
If you really want to unit test suitescript correctly, then I would separate your business logic into non-netsuite method dependent functions and test those functions using whatever flavor of js testing framework you want
creece
06/11/2020, 7:16 PM
You can then just mock up your function inputs as if they came from netsuite and have at it.
s
Sandii
06/11/2020, 7:26 PM
Yeah, the main issue with that is I've found generally the issues with my code in NS are the use of the NS APIs/data retrieval steps in the code.
a
alien4u
06/11/2020, 7:57 PM
Define your goal when you mention unit testing, I had seen many people asking about unit testing when they really want to know about performance which is a different monster specially with NetSuite.
Optimization in NetSuite is almost no-needed or a waste of time because your code would be transpile or transcompile to Java for all server side scripts and therefore you could be losing any optimization right there.
h
huzaifa
06/12/2020, 9:16 PM
@alien4u when I say "Unit testing" I mean exactly that. If I want to perf test, I would literally mention it the same goes for Optimization 🙂