Commit Graph

2 Commits

Author SHA1 Message Date
Joey Parrish b105199276 fix(test): Fix test failure on IE11
One subtlety of the filterDescribe() helper in our tests is that it
does not stop the body of the describe() block from being executed.
It only suppresses the execution of the various "before/after" blocks
and the tests in it().  So the new functional unit tests on factory
functions failed on IE, since the various definitions being eval'd for
the tests were set in the describe() body.  Now they are created in
beforeAll(), which is supressed on non-ES6 platforms.

Change-Id: Ia92c7aa33a89e0217bf9a0394b43753f120ec16d
2020-11-10 00:19:53 +00:00
Joey Parrish 9ece285b92 fix: Fix compatibility for plugin factories
In v3.0, we changed our plugin interfaces so that all are factories
that return objects.  We no longer call those with "new" as we did in
v2.5.

We provided backward compatibility and a deprecation warning to alert
applications to update their usage of those interfaces.  However, this
compatibility shim was broken for ES6 classes, which behaved
differently than ES5 constructor functions.

This fixes the shim and adds regression tests.  The tests were tricky
because we use Babel to transpile our tests, but we needed raw,
untranspiled code to define a class to test these features.  So we use
eval and some associated trickery to get exactly the different kinds
of plugin registrations we intend to support.  These tests are skipped
on non-ES6 browsers.

Fixes #2958

Change-Id: Ife8b63c0d89f4ea0aff085d3a4c156c4eb657604
2020-11-03 21:58:44 +00:00