Tests
This is a list of major test scripts used to check all functionalities. Those scripts are pure Javascript files which are tested using the sample code:
protected object Test(string script)
{
JintEngine jint = new JintEngine(script);
jint.SetFunction("assert", new Action<object, object>(Assert.AreEqual));
jint.SetFunction("istrue", new Action<bool>(Assert.IsTrue));
jint.SetFunction("isfalse", new Action<bool>(Assert.IsFalse));
jint.SetFunction("alert", new Action<object>(s => System.Diagnostics.Trace.WriteLine(s)));
return jint.Run();
}
As you can see, multiple test methods are declared inside the script engine to be called directly from the Javascript code.