kungfooman / RuntimeTypeInspector.js

Checking JSDoc types at runtime for high-quality types - Trust is good, control is better.
MIT License
8 stars 0 forks source link

Test the runtime #57

Closed kungfooman closed 9 months ago

kungfooman commented 9 months ago

Currently only the transpiler is tested, but I have to test the runtime aswell. Especially since there are many finicky cases:

1) Transformers.js is creating callable class instances and they are considers "typeof value === 'function'" but also value instanceof Object... no big surprise here.

2) typeof Object.create(null) ==='object' but not Object.create(null) instanceof Object

So neither can we use only typeof nor instanceof... and these kinds of cases require tests, since it's beyond obvious, but also easier functions should have a bunch of tests each.