svelte-dev-helper
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -102,3 +102,3 @@ import Registry from './registry'; | ||
if (!keepInsertionPoint) { | ||
if (!keepInsertionPoint && this.__insertionPoint) { | ||
//deref for GC before removal of node | ||
@@ -216,3 +216,8 @@ this.__insertionPoint.__component__ = null; | ||
const originalComponent = Registry.get(id).component; | ||
if (originalComponent.preload) { | ||
proxyComponent.preload = originalComponent.preload; | ||
} | ||
return proxyComponent; | ||
} |
{ | ||
"name": "svelte-dev-helper", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Helper for svelte components to ease development", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,3 @@ # svelte-dev-helper | ||
Helper for svelte components to ease development. | ||
Used under the hood by [svelte-hot-loader](https://github.com/ekhaled/svelte-hot-loader). | ||
Used under the hood by [svelte-loader](https://github.com/sveltejs/svelte-loader). | ||
@@ -9,0 +9,0 @@ |
@@ -9,2 +9,3 @@ /* global describe, it */ | ||
const ErrorComponent = require('./fixtures/mockComponentWithError').default; | ||
const PreloadComponent = require('./fixtures/mockComponentWithPreload').default; | ||
@@ -36,2 +37,3 @@ chai.use(sinonChai); | ||
const id = 'fixtures\\mockComponent.html'; | ||
const idPreload = 'fixtures\\mockComponentWithPreload.html'; | ||
const allMethods = 'get,fire,observe,on,set,teardown,_recompute,_set,_mount,_unmount,destroy,_register,_rerender'.split(','); | ||
@@ -45,3 +47,4 @@ const straightProxiedMethods = allMethods.slice(0, 7); | ||
SpiedComponent2 = spy(Component), | ||
SpiedErrorComponent = spy(ErrorComponent); | ||
SpiedErrorComponent = spy(ErrorComponent), | ||
SpiedPreload = spy(PreloadComponent, 'preload'); | ||
@@ -54,4 +57,11 @@ Registry.set(id, { | ||
Registry.set(idPreload, { | ||
rollback: null, | ||
component: PreloadComponent, | ||
instances: [] | ||
}); | ||
const Wrapped = createProxy(id), | ||
wrappedComponent = new Wrapped({}); | ||
wrappedComponent = new Wrapped({}), | ||
PreloadWrapped = createProxy(idPreload); | ||
@@ -64,2 +74,7 @@ let methodSpies = {}; | ||
it('should forward calls to static preload method', function() { | ||
PreloadWrapped.preload(); | ||
expect(SpiedPreload).to.be.calledOnce; | ||
}); | ||
it('should contain the right component and instance in Registry', function() { | ||
@@ -66,0 +81,0 @@ const item = Registry.get(id); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21474
14
469