public async Task CharacterEscapeTest() { var runtime = new NodeJSRuntime(Array.Empty <string>()); const string js = "'\\t'"; // literal JS: // console.log('\t') const string serialized = "\"\\t\""; const string expected = "\t"; var output = (await runtime.InvokeAsyncImpl(js, null)).StandardOutput; Assert(output == serialized + "\n"); // newline is standardoutput artifact var deserialized = JsonSerializer.Deserialize <string>(serialized, runtime.Options); Assert(deserialized == expected); // combination of both tests above: var result = await runtime.InvokeAsync <string>(js, null).AsTask(); Assert(result == expected); }
public KaTeXTypesSerializationTests() { jsRuntime = NodeJSRuntime.CreateDefault(); KaTeX = IKaTeX.Create(jsRuntime); }
public HtmlDomNodeTests() { jsRuntime = NodeJSRuntime.CreateDefault(); KaTeX = IKaTeX.Create(jsRuntime); }