Widget Tester offers you ideal tests for JavaScript. The code can be inserted manually via a specially designed multiline text area, or by dragging a text chain or file to the JS button. You can also insert simple commands via the command line.
In a word, Widget Tester is also a widget itself, that works to run evaluations on code you indicate, and shows its results in the debug window. Thus you can examine global variables, run functions and expressions, etc.