Going to give it another shot: Are there any devel...
# general
s
Going to give it another shot: Are there any developers that tried using the JEST framework to test their scripts? (supported via CLI)
b
you probably dont want to learn how to write tests from netsuite
learn how to use jest in general, there are plenty of resources online, jest is very popular
if you learn jest from following netsuite's example, you write tests on script entry points, which will be miserable on anything complicated
s
But I'm looking for examples of the mock ups for N/records for example
Hmm if you don't use entry points, can you test only portions or specific functions of a script?
b
its the point of unit testing, test small pieces of code
testing the entry points is basically all the code
the mocks is basically a learn jest thing
what netsuite provides isnt particularly valuable, its basically just lists of functions
s
So for example if I am trying to take the result from a search and save it on a record, I would have to mock the result obj of the saved search, and then mock the record get value of the field I'm saving to confirm that it has been set?
b
depends on what your code looks like, but you will be mocking the behavior of everything your code uses
s
I see, and are you aware of any library that are premade or everytime we have to mock from scratch every object?
b
none that i know of, you will have to write your own behavior