web-platform-tests / web-platform-tests/wpt
Automatically add an environement prefix to test name
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 6.2k
- Forks
- 3.9k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 586
Description
Originally posted as https://github.com/w3c/testharness.js/issues/168 by @abreton on 15 Dec 2015, 13:37 UTC:
It would be nice to run some javascript tests in different environments (windows, workers, service workers) without duplicating html files. The idea is to have a js file with all the tests written in it and then running them in different environment from the same html file.
For example if we use a test.js which has a test named test1. We could have something like this in the html file:<script src="test.js"></script> <script> fetch_tests_from_worker(new Worker("test.js")); fetch_tests_from_worker(new SharedWorker("test.js", "mySharedWorker" )); </script>Then testharness could rename each test in order to have different names depending on environment, e.g.:
Result Test Name Message PASS Test1 PASS [Worker] Test1 PASS [SharedWorker] Test1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the issue's proposed test.js usage and the fetch_tests_from_worker calls for Worker and SharedWorker environments. Trace how test names are collected and reported, then verify that each environment receives the requested prefix while the original test keeps its existing name. Done means the result table distinguishes the environments without duplicating HTML files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100