Open sarahghp opened 2 years ago
I would be very surprised to hear that somebody found test262 as the easiest way to learn the spec - it doesn't seem to me that it'd be a particularly approachable path.
fwiw, my path in (only one of a great many, obviously) was by reading the spec text of API methods i already understood in JS, and then trying to learn an API method that i didn't know in JS, by reading it in the spec.
I don't know either way whether this usage exists, so this is just my speculation: I'd guess test262 would need to be more widely known among developers for this to be a common usage.
I could imagine it being used as a resource where you look up "what happens if I do X?" where X is something too esoteric to be covered in MDN. You can, of course, look that up in ECMA-262 as well, but reading the spec text is a separate skill whereas reading a test262 test requires reading JS code, a skill that the developer presumably already has. (So on that count I would not be as surprised as Jordan if someone found test262 more approachable than ECMA-262.)
I could imagine that a website with a search function (e.g., show me all tests that call Function.prototype.toString) would help people use test262 this way.
I don't really have an opinion on whether this is a desirable community to serve. For me it depends on whether there is demand for it, and how much time and energy would have to go into facilitating it before we knew whether there would be demand.
Yes, for me, I like to see code in use, so it would be useful to be able to use Test262 that way — I've definitely, in working on the growable/resizable array buffer test plan, found it helpful to compare between the text in the frontmatter and the tests below.
This points to the situation as well where the functionality we are talking about is still a proposal and not covered by MDN. For instance, with Temporal, I found looking at the tests helpful for understanding what to expect in cases where the broader documentation was less clear. (Although the demitasse tests were more helpful than the Test262 variety, which points to the gaps here.)
It suits me for this to be a constituency because I would like it, but I am one person. I think you're right @ptomato that it's a little chicken and egg; to really see if the constituency exists, we'd need to do more around it, and maybe we have plenty of work to do already.
Those are both really good motivations to read the tests for the purposes of learning; i wasn't trying to imply they weren't good for that, just providing my data point of surprise :-)
As mentioned in https://github.com/tc39/test262/issues/3433 and related discussions, I have wondered whether there is a constituency using this project as a way to understand the spec or the language as a whole, the way unit tests are often used in codebases as a demo of the function under test.
Do we know of people who do use the repo this way? Is this a desirable community to serve?