Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert tests.js to JSON #224

Closed
PolariTOON opened this issue Jan 12, 2022 · 1 comment
Closed

Convert tests.js to JSON #224

PolariTOON opened this issue Jan 12, 2022 · 1 comment
Labels

Comments

@PolariTOON
Copy link
Collaborator

The file tests.js is a massive piece of code that describes hundreds of recognition tests for CSS features as unique non-cyclic entry point (window.Specs) that is never modified afterwards.
That seems like a perfect candidate for being converted to one or multiple JSON files.

This would make the tests machine-readable, but also serializables, allowing external scripts to be run on them.
As an use case, later, we could even imagine generating automatically some tests from the CSS syntax and dumping them as JSON files.

Currently, we already do generate some tests with the help of concat, add and times array methods, but i currently count only about twenty such occurrences in the whole testbase, thus making a very minor part of it.
So converting to JSON would need to manually expand those tests but it should not be a big hurdle. We could also create a declarative syntax for these functions instead.

This currently somehow conflicts with the proposal in #219, that would like to split tests.js into individual JS modules, statically imported, since the current story with JSON files in browsers is that they cannot be imported as modules, but rather have to be fetched dynamically (we would have to wait for import assertions to land first to become able to statically import them as modules).

@SebastianZ
Copy link
Collaborator

Because we ended up splitting the tests up into several files in #219 and we define DOM tests via functions since #236, converting the tests to JSON became obsolete. Therefore I close this issue now.

Sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants