Forum Discussion

kakabubu's avatar
kakabubu
Contributor
9 months ago
Solved

functions stopped running (JS)

I've tried to rename the project suite yesterday and move it to a different folder in Git. 
After that, I started receiving  "ReferenceError: helper is not defined" message from my 'events,js' file
Code there looks like this:

 

 

 

const helper = require('helper');

/** Param {object} Sender*/
function GeneralEvents_OnStartTest(Sender) {
  if (!helper.isTest()) return true;
}

 

 

 

I did not commit these changes, so I had the last stable version in Git. I tried deleting the folder and cloning it from repository. Then I even tried to reinstall test complete and restart the OS. It did not help. After I've deleting events.js in order to try runing any function that does not require any other functions from different files
Now when I run that test function that just logs a message and nothing else:
The run is started, and then immediately finished. No errors are posted to the logs, but the message is not posted also.
Looks like It just doesn't run the code inside the function 
At the same time same project works fine when run from the pipeline on our test environment.

  • Remembered later that there is an old piece of code that requires cofig.dev.json file which is gitignored
    And this code runs before all other functions and logs no error to TC logs unfortunately. 
    something like this: 

    (function setConfig() {
      /*some code here that uses config.dev.json*/
    })()

    The saddest, in this case, is that I have a Deja Vu with this problem. Seems that I need to spend time refactoring this

2 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I suggest you check your references are correct in the project .mds file. Use a text editor to look at the files.

  • Remembered later that there is an old piece of code that requires cofig.dev.json file which is gitignored
    And this code runs before all other functions and logs no error to TC logs unfortunately. 
    something like this: 

    (function setConfig() {
      /*some code here that uses config.dev.json*/
    })()

    The saddest, in this case, is that I have a Deja Vu with this problem. Seems that I need to spend time refactoring this