Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Assign options to empty object #44

Merged
merged 2 commits into from
Sep 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function syncEvent(node, eventName, newEventHandler) {
}

export default function (CustomElement, opts) {
opts = assign(defaults, opts);
opts = assign({}, defaults, opts);
const tagName = (new CustomElement()).tagName;
const displayName = pascalCase(tagName);
const { React, ReactDOM } = opts;
Expand Down
2 changes: 2 additions & 0 deletions test/unit/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ describe('prop-types', () => {

it('no react', () => {
expect(() => reactify(document.registerElement('x-errors-1'), { React: null })).to.throw(msg);
expect(() => reactify(document.registerElement('x-no-errors-1'))).to.not.throw(msg);
});

it('no react-dom', () => {
expect(() => reactify(document.registerElement('x-errors-2'), { ReactDOM: null })).to.throw(msg);
expect(() => reactify(document.registerElement('x-no-errors-2'))).to.not.throw(msg);
});
});