Re: Using WPT as unit tests for polyfill libraries?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/17/2015 08:54 AM, Glen Huang wrote:
> Hi,
> 
> I’m writing a polyfill library that would like to use Web Platform 
> Tests as unit tests

That sounds like an excellent idea.

> - How to automate the tests in multiple browsers? More 
> specifically, is it possible to integrate WPT into, say, 
> saucelabs?

Have you found wptrunner [1]?

> - Some tests are just too edge-case (e.g., toString(Event) should 
> equal "[object Function]” or class=“name name” should only return 
> one class name) to be covered by a polyfill library. Is it
> possible to cherry-pick tests without forking the project?

wptrunner has a concept of expected failures, which would allow you to
ignore any failures you don't care about. (I should note I disagree
with your premise, though: any difference, including the ones you
mentioned, can cause bugs when authors move off the polyfill to the
native implementation.)

HTH
Ms2ger

[1] http://wptrunner.readthedocs.org/en/latest/
-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJU4xfYAAoJEOXgvIL+s8n2bEcH+weRIb0+6gP2ohq2VPJUZ2mI
qbEoWx3FnzgSVIngaLLb8kEDCvoAdyQjyz+/8ch9bh2P0gQ9rO22M9dNvS4i0ZTK
cPY6gio32FXcpmR0gWBd696R9JRBMSIsruSPS6rm4k7CEoVb/0mSDZ//pDXnhPXJ
GVY1c6mUQwkWqws1JKhfbvZ7rspvAmAvs6hIwCSRchJ0QmICsW3oRYclr4nRiYxD
HzOmLgRIzVTBRcv4DirrZYLKCX1O1xEjoqeLKjebmzSzH4RpYMtIbbZ2nomZQOhq
bUONSz3FLqXlsw/JojeiMaqxLRbgCqtBUG5IM2x51ThDVvwJDZ3ZubiAzyWe28w=
=hdzV
-----END PGP SIGNATURE-----

Received on Tuesday, 17 February 2015 10:29:09 UTC