mierenmanz / eventsource Goto Github PK
View Code? Open in Web Editor NEWEventSource in Deno
EventSource in Deno
Reason for fail:
Message event's isTrusted
is set to false
Reason for fail:
No idea...
Reason for fail:
Timed out
Reason for fail:
test runs out of tasks in eventloop
Reason for fail:
No idea...
Reason for fail:
Test runs out of tasks in eventloop
Reason for fail:
No idea...
Reason for fail:
No idea...
Reason fail: Undetermined
{
"name": "EventSource: close(), test events",
"status": 1,
"message": "document.getElementsByTagName is not a function",
"stack": "TypeError: document.getElementsByTagName is not a function\n at get_script_url (http://web-platform.test:8000/resources/testharness.js:3978:32)\n at get_stack (http://web-platform.test:8000/resources/testharness.js:3801:26)\n at new AssertionError (http://web-platform.test:8000/resources/testharness.js:3773:22)\n at assert (http://web-platform.test:8000/resources/testharness.js:3763:19)\n at assert_equals (http://web-platform.test:8000/resources/testharness.js:1242:13)\n at assert_wrapper (http://web-platform.test:8000/resources/testharness.js:1186:30)\n at Test.<anonymous> (http://web-platform.test:8000/eventsource/eventsource-close.htm#0:56:15)\n at Test.step (http://web-platform.test:8000/resources/testharness.js:2087:25)\n at EventSource.onmessage (http://web-platform.test:8000/resources/testharness.js:2114:35)\n at EventSource.#fetch (file:///home/skyler/coding/jsts/eventsource/mod.ts:158:44)"
}
This is the full error stacktrace and it seems it is caused by the test and not the actual code
TypeError: document.getElementsByTagName is not a function
at get_script_url (http://web-platform.test:8000/resources/testharness.js:3978:32)
at get_stack (http://web-platform.test:8000/resources/testharness.js:3801:26)
at new AssertionError (http://web-platform.test:8000/resources/testharness.js:3773:22)
at assert (http://web-platform.test:8000/resources/testharness.js:3763:19)
at assert_equals (http://web-platform.test:8000/resources/testharness.js:1242:13)
at assert_wrapper (http://web-platform.test:8000/resources/testharness.js:1186:30)
at Test.<anonymous> (http://web-platform.test:8000/eventsource/eventsource-close.htm#0:56:15)
at Test.step (http://web-platform.test:8000/resources/testharness.js:2087:25)
at EventSource.onmessage (http://web-platform.test:8000/resources/testharness.js:2114:35)
at EventSource.#fetch (file:///home/skyler/coding/jsts/eventsource/mod.ts:158:44)
test.ts
import { EventSource } from "./mod.ts";
import { assert, assertEquals } from "https://deno.land/std/testing/asserts.ts";
function redirectTest(status: string) {
const source = new EventSource("http://localhost:8000?status=" + status);
source.onopen = function () {
assertEquals(source.readyState, source.OPEN);
console.log("OPEN");
source.close();
};
source.onerror = function (e) {
console.log(e);
assert(false, "Error");
};
}
redirectTest("301");
// redirectTest("302")
// redirectTest("303")
// redirectTest("307")
server.ts
import { serve, Response } from "https://deno.land/[email protected]/http/server.ts";
const server = serve({ port: 8000 });
for await (const conn of server) {
const ree: Response = {
headers: new Headers([
["content-type", "text/event-stream"],
["location", "http://localhost:8000"]
]),
status: Number(conn.url.split("=")[1]) ?? 200,
}
if (!Number(conn.url.split("=")[1])) ree.body = "data:ree\n\n";
console.log(conn.url, ree.body);
conn.respond(ree);
}
When you connect to this server with the test. You get greeted with error: Uncaught (in promise)
And nothing else. It seems to be an issue with this.#abortController
closing the fetch but not the response body?
Reason for fail:
Test timed out
Reason for fail:
No idea...
Reason for fail:
No idea...
Hi, can you please accept #31 and then release v0.0.3? v0.0.2 doesn't seem to be working.
Reason for fail:
No idea...
Reason for fail:
Test runs out of tasks in eventloop
Reason for fail:
Failing to fetch with \u2026
as header value
Reason for fail:
No idea...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.