Skip to content

Commit

Permalink
Updating code format to latest prettier.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Oct 9, 2020
1 parent bdf0d70 commit 6d1a496
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/single-spa-svelte.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const defaultOpts = {

// optional opts
domElementGetter: null,
props: {}
props: {},
};

export default function singleSpaSvelte(userOpts) {
Expand All @@ -14,7 +14,7 @@ export default function singleSpaSvelte(userOpts) {

const opts = {
...defaultOpts,
...userOpts
...userOpts,
};

if (!opts.component) {
Expand All @@ -28,7 +28,7 @@ export default function singleSpaSvelte(userOpts) {
bootstrap: bootstrap.bind(null, opts, mountedInstances),
mount: mount.bind(null, opts, mountedInstances),
unmount: unmount.bind(null, opts, mountedInstances),
update: update.bind(null, opts, mountedInstances)
update: update.bind(null, opts, mountedInstances),
};
}

Expand All @@ -53,7 +53,7 @@ function mount(opts, mountedInstances, singleSpaProps) {
mountedInstances.instance = new opts.component({
...svelteOpts,
target: domElement,
props: Object.assign({}, singleSpaProps, opts.props)
props: Object.assign({}, singleSpaProps, opts.props),
});
});
}
Expand Down
12 changes: 6 additions & 6 deletions src/single-spa-svelte.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ describe(`single-spa-svelte`, () => {
const component = jest.fn();
let props = {
name: "app1",
foo: "bar"
foo: "bar",
};
const $set = jest.fn(
newProps => (props = Object.assign({}, props, newProps))
(newProps) => (props = Object.assign({}, props, newProps))
);
const $destroy = jest.fn();
component.mockImplementationOnce(function() {
component.mockImplementationOnce(function () {
this.$set = $set;
this.$destroy = $destroy;
});
const lifecycles = singleSpaSvelte({
component,
props: {
thing: "value"
}
thing: "value",
},
});
expect(component).not.toHaveBeenCalled();
expect($destroy).not.toHaveBeenCalled();
Expand All @@ -34,7 +34,7 @@ describe(`single-spa-svelte`, () => {
expect(call.props).toEqual({
thing: "value",
foo: "bar",
name: "app1"
name: "app1",
});
expect($destroy).not.toHaveBeenCalled();
await lifecycles.update({ foo: "notbar" });
Expand Down

0 comments on commit 6d1a496

Please sign in to comment.