-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Why?
The wrapper is prone to human errors as it is an interpretation of the Web IDL specifications.
We have already seen such errors e.g. in PR #14. I originally didn't think that I needed to use unit tests for this project as the primary business logic was present in either the JS files or the actual browser API which would make it unsuitable for testing.
What?
What should we then test?
We have already seen that there can be some errors with the serialization because we create some of the objects used for serialization ourselves when objects have special inheritance relations. This should be tested.
We have also seen cases where we had missed special overloads of some methods from the original API. We should go through the Web IDL specifications systematically and ensure that representative methods/properties are present in the wrapper. This will also serve as an overview of which methods from the wrapper represent which methods in the underlying API which is currently not available without some exploration.
How?
- We should test the serialization of option types using some unit testing framework.
- We should ensure coverage of the API with documentation in the form of a table or diagram.