Commit 17b8ce10 authored by Robert Knight's avatar Robert Knight

Rename function to fix eslint-plugin-react crash

Naming the variable `createElement` caused a crash when running `yarn
lint` with eslint-plugin-react v7.20.4, presumably because it was being
treated like the `createElement` import from Preact/React.
parent 41f1ca4b
......@@ -25,13 +25,13 @@ describe('sidebar/util/dom', () => {
});
describe('listen', () => {
const createElement = () => ({
const createFakeElement = () => ({
addEventListener: sinon.stub(),
removeEventListener: sinon.stub(),
});
[true, false].forEach(useCapture => {
it('adds listeners for specified events', () => {
const element = createElement();
const element = createFakeElement();
const handler = sinon.stub();
listen(element, ['click', 'mousedown'], handler, { useCapture });
......@@ -53,7 +53,7 @@ describe('sidebar/util/dom', () => {
[true, false].forEach(useCapture => {
it('removes listeners when returned function is invoked', () => {
const element = createElement();
const element = createFakeElement();
const handler = sinon.stub();
const removeListeners = listen(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment