@testing-library/svelte 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pure.js +8 -6
- package/package.json +1 -1
package/dist/pure.js
CHANGED
|
@@ -39,7 +39,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
39
39
|
|
|
40
40
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
41
41
|
|
|
42
|
-
const containerCache = new
|
|
42
|
+
const containerCache = new Set();
|
|
43
43
|
const componentCache = new Set();
|
|
44
44
|
const svelteComponentOptions = ['accessors', 'anchor', 'props', 'hydrate', 'intro', 'context'];
|
|
45
45
|
|
|
@@ -83,7 +83,8 @@ const render = (Component, _ref = {}, {
|
|
|
83
83
|
let component = new ComponentConstructor(_objectSpread({
|
|
84
84
|
target
|
|
85
85
|
}, checkProps(options)));
|
|
86
|
-
containerCache.
|
|
86
|
+
containerCache.add({
|
|
87
|
+
container,
|
|
87
88
|
target,
|
|
88
89
|
component
|
|
89
90
|
});
|
|
@@ -101,7 +102,8 @@ const render = (Component, _ref = {}, {
|
|
|
101
102
|
component = new ComponentConstructor(_objectSpread({
|
|
102
103
|
target
|
|
103
104
|
}, checkProps(options)));
|
|
104
|
-
containerCache.
|
|
105
|
+
containerCache.add({
|
|
106
|
+
container,
|
|
105
107
|
target,
|
|
106
108
|
component
|
|
107
109
|
});
|
|
@@ -118,18 +120,18 @@ const render = (Component, _ref = {}, {
|
|
|
118
120
|
|
|
119
121
|
exports.render = render;
|
|
120
122
|
|
|
121
|
-
const cleanupAtContainer =
|
|
123
|
+
const cleanupAtContainer = cached => {
|
|
122
124
|
const {
|
|
123
125
|
target,
|
|
124
126
|
component
|
|
125
|
-
} =
|
|
127
|
+
} = cached;
|
|
126
128
|
if (componentCache.has(component)) component.$destroy();
|
|
127
129
|
|
|
128
130
|
if (target.parentNode === document.body) {
|
|
129
131
|
document.body.removeChild(target);
|
|
130
132
|
}
|
|
131
133
|
|
|
132
|
-
containerCache.delete(
|
|
134
|
+
containerCache.delete(cached);
|
|
133
135
|
};
|
|
134
136
|
|
|
135
137
|
const cleanup = () => {
|
package/package.json
CHANGED