Page 1 of 1

How to set up unit testing for a simple solution

PostPosted: Mon Jan 15, 2024 12:29 pm
by 258.d.852
Dear Servoy community,

I would like to test my Servoy-solution, then I do the following steps

    1. Create a soltuion, let's call my_solution_test
    2. In the scopes, I defined a new scope call, test_Service
    3. In the test_Service scope, I simply implemented the following logic

Code: Select all
function should_return_true() {
    jsunit.assertTrue(true);
}


    4. Execute the test by right-click on the solution, then choose the option: Run JS Unit Test(s)

I got the following error:
AssertionFailedError: The selection does not have jsunit tests. (JsUnit.js#691)


Could you please help me out?

Thanks

Re: How to set up unit testing for a simple solution

PostPosted: Mon Jan 15, 2024 12:37 pm
by patrick
Your method name needs to start with "test_". Have a look at this to help you get started:

https://wiki.servoy.com/display/Serv7/Unit+Testing

Re: How to set up unit testing for a simple solution

PostPosted: Mon Jan 15, 2024 2:13 pm
by 258.d.852
Thanks for your quick help!