> For the complete documentation index, see [llms.txt](https://docs.testmace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testmace.com/master/node-types/assertion-node/script.md).

# Script

A **Script assertion** allows to write a JavaScript test script. The script itself is a function named `test`, that takes an assertion object and an object with variables (a key/value pair). If the function returns `true` the test is successfull. If it returns `false` or raises an exception, then the **Script assertion** failed.

The **Script** assertion interface is as follows:

![](/files/-LgrMjndSzO9ONPPuSAl)

**Script** is the only field this assertion has, and it contains the script described above.

### Error Fixing

This assertion doesn't have any error fixing algorythm.

### File Representation

The assertion has the `script` type in the file. The type description can be found in [Assertion file representation](/master/node-types/assertion-node.md#failovoe-predstavlenie) Assertion file representation documentation in the `#/definitions/ScriptAssertion` definition.
