You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is a great project! But I am running into a strange issue. I was not seeing the JavaScript events being fired in my code. I decided to create a new solution with a very simple test that I took from the AngleSharp.Scripting FireEventTests.cs unit tests (see below). The test passes when I run it in the AngleSharp solution but it fails when I run it from my solution. I don't understand how this is possible... am I missing something? Thanks!
[TestMethod]
public async Task MainAsyncTest()
{
var service = new JavaScriptProvider();
var cfg = Configuration.Default.With(service);
var html = "<!doctype html><div id=result>0</div><script>var i = 0; document.addEventListener('hello', function () { i++; document.querySelector('#result').textContent = i.toString(); }, false);</script>";
var document = await BrowsingContext.New(cfg).OpenAsync(m => m.Content(html));
var div = document.QuerySelector("#result");
document.Dispatch(new CustomEvent("hello"));
Assert.AreEqual("1", div.TextContent);
document.Dispatch(new CustomEvent("hello"));
Assert.AreEqual("2", div.TextContent);
}
The text was updated successfully, but these errors were encountered:
I think I found the problem... my solution was using the latest version of Jint (2.10.3). The test does not work with that version. When I switch to version 2.9.1, it works fine.
Hi, this is a great project! But I am running into a strange issue. I was not seeing the JavaScript events being fired in my code. I decided to create a new solution with a very simple test that I took from the AngleSharp.Scripting FireEventTests.cs unit tests (see below). The test passes when I run it in the AngleSharp solution but it fails when I run it from my solution. I don't understand how this is possible... am I missing something? Thanks!
The text was updated successfully, but these errors were encountered: