Long question short: Do you think there is knowled...
# suitescript
m
Long question short: Do you think there is knowledge obtained from experience that is not in the docs? For example: Should you hardcode the IDs of the custom fields, or get it from script parameters?
b
you can change your internal ids for fun if you make a metadata file with all your internal ids
and by fun i mean when someone doesnt like your internal ids
a lot of the warning i give are based on experience
m
What do you think about the first question?
hmm
I am not sure what the best consultant firms do, do they build like a knowledge base internally?
b
for example I have an unhealthy fear of server restarts, and a crippling fear of revenue recognition
m
btw, how do you do the testing?
b
mocha based tests
m
will try to push the team culture to do more testing. thanks very much.
@battk btw, I hope I will be able to help other programmers in the future when I have enough knowledge, like you do. Thanks man.
b
you may want to consider jest based tests for netsuite, their sdf team chose it for integration into sdf
c
great question, short answers is yes. There's a ton you will learn by 'just doing it' that the docs don't cover
❤️ 1
m
@battk When you write tests, you host it on NS, right? let's say you want to test a Restlet that should create a certain record. To check that this record was created you need the code to be on NS, not locally. Otherwise, you will need another Restlet that tells you if the record was created or not. Right?
b
No, test in node and stub or mock the suitescript api you use
If you are truly dedicated, you can probably get a browser compatible testing framework running in suitescript if you remove functionality related to setTimeout
m
Actually I don't think that my manager cares, but I still want to learn it.
b
Again, i do mocha tests, while the suitecloud unit testing uses jest
m
I still don't understand how do you call Netsuite? Let's consider my example, how would you check if a record has been created or not?
b
You dont, you create a mock record with fake functions
And write expectations that check that the fake functions were called with the correct parameters
m
I think I need to read more, after reading I will understand what you mean. Actually I didn't do testing before expect in Go, which is very straight forward. But didn't get deeper in in testing.