[change] Remove jest preset

Also add node-based unit tests for SSR APIs.
This commit is contained in:
Nicolas Gallagher
2022-03-02 10:50:04 -08:00
parent b27c9820db
commit 9b0c1193a2
7 changed files with 33 additions and 89 deletions
+26
View File
@@ -0,0 +1,26 @@
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// JSDOM doesn't implement ResizeObserver
class ResizeObserver {
disconnect() {}
observe() {}
unobserve() {}
}
window.ResizeObserver = ResizeObserver;
// JSDOM doesn't provide values for 'clientWidth' etc
Object.defineProperty(window.document.documentElement, 'clientHeight', {
get: function () {
return this._jsdomClientWidth || window.innerHeight;
}
});
Object.defineProperty(window.document.documentElement, 'clientWidth', {
get: function () {
return this._jsdomClientWidth || window.innerWidth;
}
});