#unit-test javascript functions

1 messages · Page 1 of 1 (latest)

robust scaffold
#

Is there a way to unit-test javascript functions that we write in appsmith?

inland jungleBOT
#

Hi There!
Thanks for reaching out to us. One of our engineer will be with you shortly.

If you are stuck with an issue/error, please help us with following information.

  1. Which version of Appsmith are you on?
  2. Provide screenshots/screen recordings of the original error/code snippet.
  3. Add details about your use case and provide steps to reproduce the issue, if
    possible.
#

Hi! Can you elaborate a bit on the use case here?

robust scaffold
#

In a large, complex application, we need to write a lot of javascript functions that contain business logic. It would be great if we could write unit tests for these functions.
Example:
let's say we have a function with some logic
someFunction:(a,b)=>{return a+b}

it would be nice to be able to specify a unit test for that function like
test('add 1 + 2 to equal 3', () => {
expect(someFunction(1,2)).toBe(3)})