From 69870ccce64e5817b4b4c7d97e74b4fff0fbfa86 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Wed, 14 Oct 2020 11:33:16 +0000 Subject: [PATCH] Bug 1669956 - [devtools] Enable eslint for devtools/client/shared/components/reps. r=jdescottes. Differential Revision: https://phabricator.services.mozilla.com/D93370 --- .eslintignore | 3 - .../client/shared/components/reps/index.js | 15 +++-- .../reps/object-inspector/actions.js | 6 +- .../components/ObjectInspector.js | 10 +-- .../components/ObjectInspectorItem.js | 6 +- .../components/reps/object-inspector/index.js | 8 +-- .../reps/object-inspector/tests/.eslintrc.js | 10 +++ .../object-inspector/tests/component/basic.js | 8 +-- .../tests/component/classnames.js | 4 +- .../component/create-long-string-front.js | 6 +- .../tests/component/create-object-client.js | 6 +- .../tests/component/entries.js | 12 ++-- .../tests/component/events.js | 6 +- .../tests/component/expand.js | 14 ++-- .../tests/component/function.js | 10 +-- .../tests/component/getter-setter.js | 10 +-- .../tests/component/keyboard-navigation.js | 6 +- .../tests/component/properties.js | 8 +-- .../object-inspector/tests/component/proxy.js | 10 +-- .../tests/component/should-item-update.js | 6 +- .../tests/component/window.js | 8 +-- .../reps/object-inspector/tests/test-utils.js | 10 +-- .../tests/utils/create-node.js | 2 +- .../tests/utils/get-children.js | 14 ++-- .../tests/utils/get-closest-grip-node.js | 2 +- .../object-inspector/tests/utils/get-value.js | 2 +- .../tests/utils/make-node-for-properties.js | 6 +- .../tests/utils/make-numerical-buckets.js | 4 +- .../tests/utils/node-has-entries.js | 6 +- .../tests/utils/node-is-window.js | 4 +- .../node-supports-numerical-bucketing.js | 6 +- .../object-inspector/tests/utils/promises.js | 2 +- .../tests/utils/should-load-item-entries.js | 8 +-- .../tests/utils/should-load-item-full-text.js | 6 +- .../should-load-item-indexed-properties.js | 14 ++-- ...should-load-item-non-indexed-properties.js | 14 ++-- .../tests/utils/should-load-item-prototype.js | 14 ++-- .../tests/utils/should-load-item-symbols.js | 14 ++-- .../utils/should-render-roots-in-reps.js | 18 ++--- .../reps/object-inspector/utils/client.js | 2 +- .../reps/object-inspector/utils/index.js | 12 ++-- .../object-inspector/utils/load-properties.js | 4 +- .../reps/object-inspector/utils/node.js | 16 ++--- .../shared/components/reps/reps/accessible.js | 11 +++- .../shared/components/reps/reps/accessor.js | 15 ++++- .../shared/components/reps/reps/array.js | 12 +++- .../shared/components/reps/reps/attribute.js | 12 +++- .../shared/components/reps/reps/big-int.js | 7 +- .../shared/components/reps/reps/caption.js | 6 +- .../components/reps/reps/comment-node.js | 10 ++- .../shared/components/reps/reps/constants.js | 2 + .../shared/components/reps/reps/date-time.js | 8 ++- .../components/reps/reps/document-type.js | 8 ++- .../shared/components/reps/reps/document.js | 4 +- .../components/reps/reps/element-node.js | 16 ++++- .../shared/components/reps/reps/error.js | 21 ++++-- .../shared/components/reps/reps/event.js | 13 +++- .../shared/components/reps/reps/function.js | 13 +++- .../shared/components/reps/reps/grip-array.js | 18 +++-- .../components/reps/reps/grip-map-entry.js | 12 +++- .../shared/components/reps/reps/grip-map.js | 18 +++-- .../shared/components/reps/reps/grip.js | 16 +++-- .../shared/components/reps/reps/infinity.js | 7 +- .../client/shared/components/reps/reps/nan.js | 7 +- .../shared/components/reps/reps/null.js | 6 +- .../shared/components/reps/reps/number.js | 7 +- .../components/reps/reps/object-with-text.js | 10 ++- .../components/reps/reps/object-with-url.js | 8 ++- .../shared/components/reps/reps/object.js | 13 +++- .../shared/components/reps/reps/promise.js | 16 +++-- .../shared/components/reps/reps/prop-rep.js | 15 +++-- .../shared/components/reps/reps/regexp.js | 9 ++- .../shared/components/reps/reps/rep-utils.js | 2 + .../client/shared/components/reps/reps/rep.js | 66 ++++++++++--------- .../shared/components/reps/reps/string.js | 4 +- .../components/reps/reps/stubs/accessible.js | 2 + .../components/reps/reps/stubs/accessor.js | 2 + .../components/reps/reps/stubs/attribute.js | 2 + .../components/reps/reps/stubs/big-int.js | 2 + .../reps/reps/stubs/comment-node.js | 2 + .../components/reps/reps/stubs/date-time.js | 2 + .../reps/reps/stubs/document-type.js | 2 + .../components/reps/reps/stubs/document.js | 2 + .../reps/reps/stubs/element-node.js | 2 + .../components/reps/reps/stubs/error.js | 2 + .../components/reps/reps/stubs/event.js | 2 + .../components/reps/reps/stubs/failure.js | 2 + .../components/reps/reps/stubs/function.js | 2 + .../components/reps/reps/stubs/grip-array.js | 10 ++- .../reps/reps/stubs/grip-map-entry.js | 2 + .../components/reps/reps/stubs/grip-map.js | 10 ++- .../shared/components/reps/reps/stubs/grip.js | 10 ++- .../components/reps/reps/stubs/infinity.js | 2 + .../components/reps/reps/stubs/long-string.js | 2 + .../shared/components/reps/reps/stubs/nan.js | 2 + .../shared/components/reps/reps/stubs/null.js | 2 + .../components/reps/reps/stubs/number.js | 2 + .../reps/reps/stubs/object-with-text.js | 2 + .../reps/reps/stubs/object-with-url.js | 2 + .../components/reps/reps/stubs/promise.js | 2 + .../components/reps/reps/stubs/regexp.js | 2 + .../components/reps/reps/stubs/stylesheet.js | 2 + .../components/reps/reps/stubs/symbol.js | 2 + .../components/reps/reps/stubs/text-node.js | 2 + .../components/reps/reps/stubs/undefined.js | 2 + .../components/reps/reps/stubs/window.js | 2 + .../shared/components/reps/reps/stylesheet.js | 4 +- .../shared/components/reps/reps/symbol.js | 11 +++- .../components/reps/reps/tests/.eslintrc.js | 10 +++ .../components/reps/reps/tests/accessible.js | 15 +++-- .../components/reps/reps/tests/accessor.js | 9 ++- .../components/reps/reps/tests/array.js | 11 +++- .../components/reps/reps/tests/attribute.js | 13 +++- .../components/reps/reps/tests/big-int.js | 9 ++- .../reps/reps/tests/comment-node.js | 17 +++-- .../components/reps/reps/tests/date-time.js | 13 +++- .../reps/reps/tests/document-type.js | 13 +++- .../components/reps/reps/tests/document.js | 13 +++- .../reps/reps/tests/element-node.js | 25 +++++-- .../components/reps/reps/tests/error.js | 17 +++-- .../components/reps/reps/tests/event.js | 15 +++-- .../components/reps/reps/tests/failure.js | 6 +- .../components/reps/reps/tests/function.js | 14 ++-- .../components/reps/reps/tests/grip-array.js | 14 ++-- .../reps/reps/tests/grip-map-entry.js | 23 +++++-- .../components/reps/reps/tests/grip-map.js | 14 ++-- .../shared/components/reps/reps/tests/grip.js | 19 ++++-- .../reps/reps/tests/helper-tests.js | 12 +++- .../components/reps/reps/tests/infinity.js | 9 ++- .../components/reps/reps/tests/long-string.js | 17 +++-- .../shared/components/reps/reps/tests/nan.js | 9 ++- .../shared/components/reps/reps/tests/null.js | 9 ++- .../components/reps/reps/tests/number.js | 9 ++- .../reps/reps/tests/object-with-text.js | 13 +++- .../reps/reps/tests/object-with-url.js | 13 +++- .../components/reps/reps/tests/object.js | 61 +++++++++-------- .../components/reps/reps/tests/promise.js | 15 +++-- .../components/reps/reps/tests/regexp.js | 17 +++-- .../reps/reps/tests/string-with-url.js | 12 ++-- .../components/reps/reps/tests/string.js | 8 ++- .../components/reps/reps/tests/stylesheet.js | 13 +++- .../components/reps/reps/tests/symbol.js | 10 ++- .../reps/reps/tests/test-helpers.js | 16 +++-- .../components/reps/reps/tests/text-node.js | 17 +++-- .../components/reps/reps/tests/undefined.js | 9 ++- .../components/reps/reps/tests/window.js | 17 +++-- .../shared/components/reps/reps/text-node.js | 12 +++- .../shared/components/reps/reps/undefined.js | 7 +- .../shared/components/reps/reps/window.js | 8 ++- .../reps/shared/dom-node-constants.js | 2 + .../reps/shared/grip-length-bubble.js | 14 +++- .../reps/shared/redux/middleware/thunk.js | 2 + .../redux/middleware/waitUntilService.js | 2 + .../shared/components/reps/test/.eslintrc.js | 10 +++ .../reps/test/__mocks__/selection.js | 4 ++ .../shared/components/reps/test/setup-file.js | 2 + .../shared/components/reps/test/setup.js | 2 + 157 files changed, 1028 insertions(+), 438 deletions(-) create mode 100644 devtools/client/shared/components/reps/object-inspector/tests/.eslintrc.js create mode 100644 devtools/client/shared/components/reps/reps/tests/.eslintrc.js create mode 100644 devtools/client/shared/components/reps/test/.eslintrc.js diff --git a/.eslintignore b/.eslintignore index 2bf82908007b3..fca8c2651f547 100644 --- a/.eslintignore +++ b/.eslintignore @@ -66,9 +66,6 @@ devtools/client/debugger/images/ devtools/client/debugger/test/ devtools/client/debugger/index.html -# Ignore devtools imported repositories -devtools/client/shared/components/reps/ - # Ignore devtools preferences files devtools/client/preferences/ diff --git a/devtools/client/shared/components/reps/index.js b/devtools/client/shared/components/reps/index.js index 12ae52421e75f..08ebce7c07a4f 100644 --- a/devtools/client/shared/components/reps/index.js +++ b/devtools/client/shared/components/reps/index.js @@ -2,16 +2,23 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { MODE } = require("./reps/constants"); -const { REPS, getRep } = require("./reps/rep"); -const objectInspector = require("./object-inspector/index"); +"use strict"; + +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); +const objectInspector = require("devtools/client/shared/components/reps/object-inspector/index"); const { parseURLEncodedText, parseURLParams, maybeEscapePropertyName, getGripPreviewItems, -} = require("./reps/rep-utils"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); module.exports = { REPS, diff --git a/devtools/client/shared/components/reps/object-inspector/actions.js b/devtools/client/shared/components/reps/object-inspector/actions.js index 2a16c727c1ae4..e8d411cdcea5f 100644 --- a/devtools/client/shared/components/reps/object-inspector/actions.js +++ b/devtools/client/shared/components/reps/object-inspector/actions.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { loadItemProperties } = require("./utils/load-properties"); +const { loadItemProperties } = require("devtools/client/shared/components/reps/object-inspector/utils/load-properties"); const { getPathExpression, getParentFront, @@ -10,8 +10,8 @@ const { getValue, nodeIsBucket, getFront, -} = require("./utils/node"); -const { getLoadedProperties, getWatchpoints } = require("./reducer"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); +const { getLoadedProperties, getWatchpoints } = require("devtools/client/shared/components/reps/object-inspector/reducer"); /** * This action is responsible for expanding a given node, which also means that diff --git a/devtools/client/shared/components/reps/object-inspector/components/ObjectInspector.js b/devtools/client/shared/components/reps/object-inspector/components/ObjectInspector.js index a9e4af890622e..721605cbf32bb 100644 --- a/devtools/client/shared/components/reps/object-inspector/components/ObjectInspector.js +++ b/devtools/client/shared/components/reps/object-inspector/components/ObjectInspector.js @@ -8,17 +8,17 @@ const { createElement, } = require("devtools/client/shared/vendor/react"); const { connect } = require("devtools/client/shared/vendor/react-redux"); -const actions = require("../actions"); +const actions = require("devtools/client/shared/components/reps/object-inspector/actions"); -const selectors = require("../reducer"); +const selectors = require("devtools/client/shared/components/reps/object-inspector/reducer"); import Components from "devtools-components"; const Tree = createFactory(Components.Tree); -require("./ObjectInspector.css"); +require("devtools/client/shared/components/reps/object-inspector/components/ObjectInspector.css"); -const ObjectInspectorItem = createFactory(require("./ObjectInspectorItem")); +const ObjectInspectorItem = createFactory(require("devtools/client/shared/components/reps/object-inspector/components/ObjectInspectorItem")); -const Utils = require("../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { renderRep, shouldRenderRootsInReps } = Utils; const { getChildrenWithEvaluations, diff --git a/devtools/client/shared/components/reps/object-inspector/components/ObjectInspectorItem.js b/devtools/client/shared/components/reps/object-inspector/components/ObjectInspectorItem.js index 2e6d3b95ab3a1..16fe60ccf17a9 100644 --- a/devtools/client/shared/components/reps/object-inspector/components/ObjectInspectorItem.js +++ b/devtools/client/shared/components/reps/object-inspector/components/ObjectInspectorItem.js @@ -8,9 +8,11 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories"); const Services = require("Services"); const isMacOS = Services.appinfo.OS === "Darwin"; -const { MODE } = require("../../reps/constants"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); -const Utils = require("../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { getValue, diff --git a/devtools/client/shared/components/reps/object-inspector/index.js b/devtools/client/shared/components/reps/object-inspector/index.js index 4eca51fa60fa1..f142d5a0eefe6 100644 --- a/devtools/client/shared/components/reps/object-inspector/index.js +++ b/devtools/client/shared/components/reps/object-inspector/index.js @@ -2,9 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const ObjectInspector = require("./components/ObjectInspector"); -const utils = require("./utils/index"); -const reducer = require("./reducer"); -const actions = require("./actions"); +const ObjectInspector = require("devtools/client/shared/components/reps/object-inspector/components/ObjectInspector"); +const utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); +const reducer = require("devtools/client/shared/components/reps/object-inspector/reducer"); +const actions = require("devtools/client/shared/components/reps/object-inspector/actions"); module.exports = { ObjectInspector, utils, actions, reducer }; diff --git a/devtools/client/shared/components/reps/object-inspector/tests/.eslintrc.js b/devtools/client/shared/components/reps/object-inspector/tests/.eslintrc.js new file mode 100644 index 0000000000000..ffb3e70473bc8 --- /dev/null +++ b/devtools/client/shared/components/reps/object-inspector/tests/.eslintrc.js @@ -0,0 +1,10 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + env: { + jest: true, + }, +}; diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/basic.js b/devtools/client/shared/components/reps/object-inspector/tests/component/basic.js index b3b7a8d07bac4..83aed6442f212 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/basic.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/basic.js @@ -2,9 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { mountObjectInspector } = require("../test-utils"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); const { mount } = require("enzyme"); -const { createNode, NODE_TYPES } = require("../../utils/node"); +const { createNode, NODE_TYPES } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); const repsPath = "../../../reps"; const { MODE } = require(`${repsPath}/constants`); const { Rep } = require(`${repsPath}/rep`); @@ -12,8 +12,8 @@ const { formatObjectInspector, waitForDispatch, waitForLoadedProperties, -} = require("../test-utils"); -const ObjectFront = require("../__mocks__/object-front"); +} = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); const gripRepStubs = require(`${repsPath}/stubs/grip`); function generateDefaults(overrides) { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/classnames.js b/devtools/client/shared/components/reps/object-inspector/tests/component/classnames.js index 5a66b75f4d7b5..d0ac5c06b8756 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/classnames.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/classnames.js @@ -2,8 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const ObjectFront = require("../__mocks__/object-front"); -const { mountObjectInspector } = require("../test-utils"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); function generateDefaults(overrides) { return { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/create-long-string-front.js b/devtools/client/shared/components/reps/object-inspector/tests/component/create-long-string-front.js index 73ecc6d644d34..60dda7474bd13 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/create-long-string-front.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/create-long-string-front.js @@ -4,9 +4,9 @@ /* global jest */ -const { mountObjectInspector } = require("../test-utils"); -const ObjectFront = require("../__mocks__/object-front"); -const { LongStringFront } = require("../__mocks__/string-front"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); +const { LongStringFront } = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/string-front"); const repsPath = "../../../reps"; const longStringStubs = require(`${repsPath}/stubs/long-string`); diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/create-object-client.js b/devtools/client/shared/components/reps/object-inspector/tests/component/create-object-client.js index 1551454b2c4f9..6000a6cc3e004 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/create-object-client.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/create-object-client.js @@ -4,14 +4,14 @@ /* global jest */ -const { mountObjectInspector } = require("../test-utils"); -const ObjectFront = require("../__mocks__/object-front"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); const { createNode, makeNodesForEntries, makeNumericalBuckets, -} = require("../../utils/node"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); const repsPath = "../../../reps"; const gripRepStubs = require(`${repsPath}/stubs/grip`); diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/entries.js b/devtools/client/shared/components/reps/object-inspector/tests/component/entries.js index 80ea6e1341bfb..66299fea186e4 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/entries.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/entries.js @@ -4,16 +4,16 @@ /* global jest */ -const { mountObjectInspector } = require("../test-utils"); -const { MODE } = require("../../../reps/constants"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const { MODE } = require("devtools/client/shared/components/reps/reps/constants"); const { formatObjectInspector, waitForDispatch, waitForLoadedProperties, -} = require("../test-utils"); -const gripMapRepStubs = require("../../../reps/stubs/grip-map"); -const mapStubs = require("../../stubs/map"); -const ObjectFront = require("../__mocks__/object-front"); +} = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const gripMapRepStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); +const mapStubs = require("devtools/client/shared/components/reps/object-inspector/stubs/map"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); function generateDefaults(overrides) { return { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/events.js b/devtools/client/shared/components/reps/object-inspector/tests/component/events.js index af46f10c9e710..23623e4b18611 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/events.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/events.js @@ -3,10 +3,10 @@ * file, You can obtain one at . */ /* global jest */ -const { mountObjectInspector } = require("../test-utils"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); -const gripRepStubs = require("../../../reps/stubs/grip"); -const ObjectFront = require("../__mocks__/object-front"); +const gripRepStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); function generateDefaults(overrides) { return { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/expand.js b/devtools/client/shared/components/reps/object-inspector/tests/component/expand.js index 9c5bff13f7c1f..d586f35ed2116 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/expand.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/expand.js @@ -1,22 +1,22 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { mountObjectInspector } = require("../test-utils"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); const repsPath = "../../../reps"; const { MODE } = require(`${repsPath}/constants`); -const ObjectFront = require("../__mocks__/object-front"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); const gripRepStubs = require(`${repsPath}/stubs/grip`); -const gripPropertiesStubs = require("../../stubs/grip"); +const gripPropertiesStubs = require("devtools/client/shared/components/reps/object-inspector/stubs/grip"); const { formatObjectInspector, storeHasExactExpandedPaths, storeHasExpandedPath, storeHasLoadedProperty, waitForDispatch, -} = require("../test-utils"); -const { createNode, NODE_TYPES } = require("../../utils/node"); -const { getExpandedPaths } = require("../../reducer"); +} = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const { createNode, NODE_TYPES } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); +const { getExpandedPaths } = require("devtools/client/shared/components/reps/object-inspector/reducer"); const protoStub = { prototype: { @@ -48,7 +48,7 @@ function generateDefaults(overrides) { ...overrides, }; } -const { LongStringFront } = require("../__mocks__/string-front"); +const { LongStringFront } = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/string-front"); function getClient(overrides = {}) { return { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/function.js b/devtools/client/shared/components/reps/object-inspector/tests/component/function.js index 45c014e59b78d..4589d5c2bcd6a 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/function.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/function.js @@ -2,12 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { mountObjectInspector } = require("../test-utils"); -const { MODE } = require("../../../reps/constants"); -const { createNode } = require("../../utils/node"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const { MODE } = require("devtools/client/shared/components/reps/reps/constants"); +const { createNode } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); -const functionStubs = require("../../../reps/stubs/function"); -const ObjectFront = require("../__mocks__/object-front"); +const functionStubs = require("devtools/client/shared/components/reps/reps/stubs/function"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); function generateDefaults(overrides) { return { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/getter-setter.js b/devtools/client/shared/components/reps/object-inspector/tests/component/getter-setter.js index 87894f9e20b0a..12d1f9354645a 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/getter-setter.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/getter-setter.js @@ -2,16 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { MODE } = require("../../../reps/constants"); +const { MODE } = require("devtools/client/shared/components/reps/reps/constants"); const { formatObjectInspector, waitForLoadedProperties, mountObjectInspector, -} = require("../test-utils"); +} = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); -const { makeNodesForProperties } = require("../../utils/node"); -const accessorStubs = require("../../../reps/stubs/accessor"); -const ObjectFront = require("../__mocks__/object-front"); +const { makeNodesForProperties } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); +const accessorStubs = require("devtools/client/shared/components/reps/reps/stubs/accessor"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); function generateDefaults(overrides) { return { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/keyboard-navigation.js b/devtools/client/shared/components/reps/object-inspector/tests/component/keyboard-navigation.js index f0ea389ae755a..090e161ec25ba 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/keyboard-navigation.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/keyboard-navigation.js @@ -2,12 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { mountObjectInspector } = require("../test-utils"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); const repsPath = "../../../reps"; const { MODE } = require(`${repsPath}/constants`); -const { formatObjectInspector, waitForDispatch } = require("../test-utils"); -const ObjectFront = require("../__mocks__/object-front"); +const { formatObjectInspector, waitForDispatch } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); const gripRepStubs = require(`${repsPath}/stubs/grip`); function generateDefaults(overrides) { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/properties.js b/devtools/client/shared/components/reps/object-inspector/tests/component/properties.js index 6850f181852cf..76df0af946a44 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/properties.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/properties.js @@ -4,11 +4,11 @@ /* global jest */ -const { mountObjectInspector } = require("../test-utils"); -const gripRepStubs = require("../../../reps/stubs/grip"); -const ObjectFront = require("../__mocks__/object-front"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const gripRepStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); -const { formatObjectInspector } = require("../test-utils"); +const { formatObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); function generateDefaults(overrides) { return { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/proxy.js b/devtools/client/shared/components/reps/object-inspector/tests/component/proxy.js index 6acf9b864f237..1f60c9838fbc5 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/proxy.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/proxy.js @@ -3,15 +3,15 @@ * file, You can obtain one at . */ /* global jest */ -const { mountObjectInspector } = require("../test-utils"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); -const { MODE } = require("../../../reps/constants"); -const gripStubs = require("../../../reps/stubs/grip"); +const { MODE } = require("devtools/client/shared/components/reps/reps/constants"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); const stub = gripStubs.get("testProxy"); const proxySlots = gripStubs.get("testProxySlots"); -const { formatObjectInspector } = require("../test-utils"); +const { formatObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); -const ObjectFront = require("../__mocks__/object-front"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); function generateDefaults(overrides) { return { roots: [ diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/should-item-update.js b/devtools/client/shared/components/reps/object-inspector/tests/component/should-item-update.js index bf8e8bbc58687..5982434a14a2f 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/should-item-update.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/should-item-update.js @@ -4,9 +4,9 @@ /* global jest */ -const { mountObjectInspector } = require("../test-utils"); -const ObjectFront = require("../__mocks__/object-front"); -const { LongStringFront } = require("../__mocks__/string-front"); +const { mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); +const { LongStringFront } = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/string-front"); const repsPath = "../../../reps"; const longStringStubs = require(`${repsPath}/stubs/long-string`); diff --git a/devtools/client/shared/components/reps/object-inspector/tests/component/window.js b/devtools/client/shared/components/reps/object-inspector/tests/component/window.js index 5b4c4bebbf1d0..583ffe0efcf88 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/component/window.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/component/window.js @@ -2,11 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { createNode } = require("../../utils/node"); -const { waitForDispatch, mountObjectInspector } = require("../test-utils"); +const { createNode } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); +const { waitForDispatch, mountObjectInspector } = require("devtools/client/shared/components/reps/object-inspector/tests/test-utils"); -const gripWindowStubs = require("../../../reps/stubs/window"); -const ObjectFront = require("../__mocks__/object-front"); +const gripWindowStubs = require("devtools/client/shared/components/reps/reps/stubs/window"); +const ObjectFront = require("devtools/client/shared/components/reps/object-inspector/tests/__mocks__/object-front"); const windowNode = createNode({ name: "window", contents: { value: gripWindowStubs.get("Window") }, diff --git a/devtools/client/shared/components/reps/object-inspector/tests/test-utils.js b/devtools/client/shared/components/reps/object-inspector/tests/test-utils.js index 4b66d2cf34a38..92bf858b84b8f 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/test-utils.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/test-utils.js @@ -8,10 +8,10 @@ const { createFactory } = require("devtools/client/shared/vendor/react"); const { Provider } = require("devtools/client/shared/vendor/react-redux"); const { combineReducers } = require("devtools/client/shared/vendor/redux"); -const { thunk } = require("../../shared/redux/middleware/thunk"); +const { thunk } = require("devtools/client/shared/components/reps/shared/redux/middleware/thunk"); const { waitUntilService, -} = require("../../shared/redux/middleware/waitUntilService"); +} = require("devtools/client/shared/components/reps/shared/redux/middleware/waitUntilService"); /** * Redux store utils @@ -20,19 +20,19 @@ const { import { createStore, applyMiddleware } from "redux"; -const objectInspector = require("../index"); +const objectInspector = require("devtools/client/shared/components/reps/object-inspector/index"); const { getLoadedProperties, getLoadedPropertyKeys, getExpandedPaths, getExpandedPathKeys, -} = require("../reducer"); +} = require("devtools/client/shared/components/reps/object-inspector/reducer"); const ObjectInspector = createFactory(objectInspector.ObjectInspector); const { WAIT_UNTIL_TYPE, -} = require("../../shared/redux/middleware/waitUntilService"); +} = require("devtools/client/shared/components/reps/shared/redux/middleware/waitUntilService"); /* * Takes an Enzyme wrapper (obtained with mount/shallow/…) and diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/create-node.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/create-node.js index a16d6f61c1ca5..6b071d196f55b 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/create-node.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/create-node.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { createNode, NODE_TYPES } = require("../../utils/node"); +const { createNode, NODE_TYPES } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); describe("createNode", () => { it("returns null when contents is undefined", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/get-children.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/get-children.js index 442d951a4fe45..7326625b6dfa5 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/get-children.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/get-children.js @@ -2,19 +2,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const accessorStubs = require("../../../reps/stubs/accessor"); -const performanceStubs = require("../../stubs/performance"); -const gripMapStubs = require("../../../reps/stubs/grip-map"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripMapEntryStubs = require("../../../reps/stubs/grip-map-entry"); -const gripStubs = require("../../../reps/stubs/grip"); +const accessorStubs = require("devtools/client/shared/components/reps/reps/stubs/accessor"); +const performanceStubs = require("devtools/client/shared/components/reps/object-inspector/stubs/performance"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripMapEntryStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map-entry"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); const { createNode, getChildren, getValue, makeNodesForProperties, -} = require("../../utils/node"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); function createRootNodeWithAccessorProperty(accessorStub) { const node = { name: "root", path: "rootpath" }; diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/get-closest-grip-node.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/get-closest-grip-node.js index 1e785a7cfa4aa..459454ef2cc69 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/get-closest-grip-node.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/get-closest-grip-node.js @@ -7,7 +7,7 @@ const { getClosestGripNode, makeNodesForEntries, makeNumericalBuckets, -} = require("../../utils/node"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); const repsPath = "../../../reps"; const gripRepStubs = require(`${repsPath}/stubs/grip`); diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/get-value.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/get-value.js index 893a3278553f9..5e5bf23884c42 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/get-value.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/get-value.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { getValue } = require("../../utils/node"); +const { getValue } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); describe("getValue", () => { it("get the value from contents.value", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/make-node-for-properties.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/make-node-for-properties.js index 36babe5e8521a..7e9ffa38efdf1 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/make-node-for-properties.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/make-node-for-properties.js @@ -9,8 +9,8 @@ const { nodeIsEntries, nodeIsMapEntry, nodeIsPrototype, -} = require("../../utils/node"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); const root = { path: "root", @@ -227,7 +227,7 @@ describe("makeNodesForProperties", () => { }); it("object with entries", () => { - const gripMapStubs = require("../../../reps/stubs/grip-map"); + const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); const mapNode = createNode({ name: "map", diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/make-numerical-buckets.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/make-numerical-buckets.js index 3c33c57ec834a..e6ef65564f101 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/make-numerical-buckets.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/make-numerical-buckets.js @@ -2,8 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { createNode, makeNumericalBuckets } = require("../../utils/node"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); +const { createNode, makeNumericalBuckets } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); describe("makeNumericalBuckets", () => { it("handles simple numerical buckets", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/node-has-entries.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/node-has-entries.js index ec27d8d4fd7dc..20b90147b8e82 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/node-has-entries.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/node-has-entries.js @@ -2,10 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripMapStubs = require("../../../reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); -const { createNode, nodeHasEntries } = require("../../utils/node"); +const { createNode, nodeHasEntries } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); const createRootNode = value => createNode({ name: "root", contents: { value } }); diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/node-is-window.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/node-is-window.js index 09202c0806d35..21c321a73fe2e 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/node-is-window.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/node-is-window.js @@ -2,9 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const gripWindowStubs = require("../../../reps/stubs/window"); +const gripWindowStubs = require("devtools/client/shared/components/reps/reps/stubs/window"); -const { createNode, nodeIsWindow } = require("../../utils/node"); +const { createNode, nodeIsWindow } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); const createRootNode = value => createNode({ name: "root", contents: { value } }); diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/node-supports-numerical-bucketing.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/node-supports-numerical-bucketing.js index a8041f8fa0850..e82a90a1dfab0 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/node-supports-numerical-bucketing.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/node-supports-numerical-bucketing.js @@ -6,7 +6,7 @@ const { createNode, makeNodesForEntries, nodeSupportsNumericalBucketing, -} = require("../../utils/node"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); const createRootNode = stub => createNode({ @@ -14,8 +14,8 @@ const createRootNode = stub => contents: { value: stub }, }); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripMapStubs = require("../../../reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); describe("nodeSupportsNumericalBucketing", () => { it("returns true for Arrays", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/promises.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/promises.js index 988a888255153..efb5dc8155667 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/promises.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/promises.js @@ -5,7 +5,7 @@ const { makeNodesForPromiseProperties, nodeIsPromise, -} = require("../../utils/node"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); describe("promises utils function", () => { it("is promise", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-entries.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-entries.js index d3912cbaea9b0..92259975c4d25 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-entries.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-entries.js @@ -2,14 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const Utils = require("../../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { createNode, getChildren, makeNodesForEntries } = Utils.node; const { shouldLoadItemEntries } = Utils.loadProperties; -const gripMapStubs = require("../../../reps/stubs/grip-map"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripStubs = require("../../../reps/stubs/grip"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); describe("shouldLoadItemEntries", () => { it("returns true for an entries node", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-full-text.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-full-text.js index 34d98946d30e1..2790f384c89b1 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-full-text.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-full-text.js @@ -2,12 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const Utils = require("../../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { createNode } = Utils.node; const { shouldLoadItemFullText } = Utils.loadProperties; -const longStringStubs = require("../../../reps/stubs/long-string"); -const symbolStubs = require("../../../reps/stubs/symbol"); +const longStringStubs = require("devtools/client/shared/components/reps/reps/stubs/long-string"); +const symbolStubs = require("devtools/client/shared/components/reps/reps/stubs/symbol"); describe("shouldLoadItemFullText", () => { it("returns true for a longString node with unloaded full text", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-indexed-properties.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-indexed-properties.js index f78202f03882e..3b5e1cc267873 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-indexed-properties.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-indexed-properties.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const Utils = require("../../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { createNode, createGetterNode, @@ -14,12 +14,12 @@ const { const { shouldLoadItemIndexedProperties } = Utils.loadProperties; -const GripMapEntryRep = require("../../../reps/grip-map-entry"); -const accessorStubs = require("../../../reps/stubs/accessor"); -const gripMapStubs = require("../../../reps/stubs/grip-map"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripStubs = require("../../../reps/stubs/grip"); -const windowStubs = require("../../../reps/stubs/window"); +const GripMapEntryRep = require("devtools/client/shared/components/reps/reps/grip-map-entry"); +const accessorStubs = require("devtools/client/shared/components/reps/reps/stubs/accessor"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const windowStubs = require("devtools/client/shared/components/reps/reps/stubs/window"); describe("shouldLoadItemIndexedProperties", () => { it("returns true for an array", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-non-indexed-properties.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-non-indexed-properties.js index 7d85119a21cff..bb9ef6c54bc72 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-non-indexed-properties.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-non-indexed-properties.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const Utils = require("../../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { createNode, createGetterNode, @@ -14,12 +14,12 @@ const { const { shouldLoadItemNonIndexedProperties } = Utils.loadProperties; -const GripMapEntryRep = require("../../../reps/grip-map-entry"); -const accessorStubs = require("../../../reps/stubs/accessor"); -const gripMapStubs = require("../../../reps/stubs/grip-map"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripStubs = require("../../../reps/stubs/grip"); -const windowStubs = require("../../../reps/stubs/window"); +const GripMapEntryRep = require("devtools/client/shared/components/reps/reps/grip-map-entry"); +const accessorStubs = require("devtools/client/shared/components/reps/reps/stubs/accessor"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const windowStubs = require("devtools/client/shared/components/reps/reps/stubs/window"); describe("shouldLoadItemNonIndexedProperties", () => { it("returns true for an array", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-prototype.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-prototype.js index d2292d308692c..e777f757fa826 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-prototype.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-prototype.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const Utils = require("../../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { createNode, createGetterNode, @@ -14,12 +14,12 @@ const { const { shouldLoadItemPrototype } = Utils.loadProperties; -const GripMapEntryRep = require("../../../reps/grip-map-entry"); -const accessorStubs = require("../../../reps/stubs/accessor"); -const gripMapStubs = require("../../../reps/stubs/grip-map"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripStubs = require("../../../reps/stubs/grip"); -const windowStubs = require("../../../reps/stubs/window"); +const GripMapEntryRep = require("devtools/client/shared/components/reps/reps/grip-map-entry"); +const accessorStubs = require("devtools/client/shared/components/reps/reps/stubs/accessor"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const windowStubs = require("devtools/client/shared/components/reps/reps/stubs/window"); describe("shouldLoadItemPrototype", () => { it("returns true for an array", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-symbols.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-symbols.js index 2adea996a1433..30e7c7ce85514 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-symbols.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-load-item-symbols.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const Utils = require("../../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { createNode, createGetterNode, @@ -14,12 +14,12 @@ const { const { shouldLoadItemSymbols } = Utils.loadProperties; -const GripMapEntryRep = require("../../../reps/grip-map-entry"); -const accessorStubs = require("../../../reps/stubs/accessor"); -const gripMapStubs = require("../../../reps/stubs/grip-map"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const gripStubs = require("../../../reps/stubs/grip"); -const windowStubs = require("../../../reps/stubs/window"); +const GripMapEntryRep = require("devtools/client/shared/components/reps/reps/grip-map-entry"); +const accessorStubs = require("devtools/client/shared/components/reps/reps/stubs/accessor"); +const gripMapStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const windowStubs = require("devtools/client/shared/components/reps/reps/stubs/window"); describe("shouldLoadItemSymbols", () => { it("returns true for an array", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-render-roots-in-reps.js b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-render-roots-in-reps.js index 7492987bde0bc..29cec5c88bead 100644 --- a/devtools/client/shared/components/reps/object-inspector/tests/utils/should-render-roots-in-reps.js +++ b/devtools/client/shared/components/reps/object-inspector/tests/utils/should-render-roots-in-reps.js @@ -2,17 +2,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const Utils = require("../../utils/index"); +const Utils = require("devtools/client/shared/components/reps/object-inspector/utils/index"); const { shouldRenderRootsInReps } = Utils; -const nullStubs = require("../../../reps/stubs/null"); -const numberStubs = require("../../../reps/stubs/number"); -const undefinedStubs = require("../../../reps/stubs/undefined"); -const gripStubs = require("../../../reps/stubs/grip"); -const gripArrayStubs = require("../../../reps/stubs/grip-array"); -const symbolStubs = require("../../../reps/stubs/symbol"); -const errorStubs = require("../../../reps/stubs/error"); -const bigIntStubs = require("../../../reps/stubs/big-int"); +const nullStubs = require("devtools/client/shared/components/reps/reps/stubs/null"); +const numberStubs = require("devtools/client/shared/components/reps/reps/stubs/number"); +const undefinedStubs = require("devtools/client/shared/components/reps/reps/stubs/undefined"); +const gripStubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const symbolStubs = require("devtools/client/shared/components/reps/reps/stubs/symbol"); +const errorStubs = require("devtools/client/shared/components/reps/reps/stubs/error"); +const bigIntStubs = require("devtools/client/shared/components/reps/reps/stubs/big-int"); describe("shouldRenderRootsInReps", () => { it("returns true for a string", () => { diff --git a/devtools/client/shared/components/reps/object-inspector/utils/client.js b/devtools/client/shared/components/reps/object-inspector/utils/client.js index 44cee24eeebac..b1438ec22a255 100644 --- a/devtools/client/shared/components/reps/object-inspector/utils/client.js +++ b/devtools/client/shared/components/reps/object-inspector/utils/client.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { getValue, nodeHasFullText } = require("../utils/node"); +const { getValue, nodeHasFullText } = require("devtools/client/shared/components/reps/object-inspector/utils/node"); async function enumIndexedProperties(objectFront, start, end) { try { diff --git a/devtools/client/shared/components/reps/object-inspector/utils/index.js b/devtools/client/shared/components/reps/object-inspector/utils/index.js index e6157d2348f42..fd431782ca291 100644 --- a/devtools/client/shared/components/reps/object-inspector/utils/index.js +++ b/devtools/client/shared/components/reps/object-inspector/utils/index.js @@ -2,16 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const client = require("./client"); -const loadProperties = require("./load-properties"); -const node = require("./node"); +const client = require("devtools/client/shared/components/reps/object-inspector/utils/client"); +const loadProperties = require("devtools/client/shared/components/reps/object-inspector/utils/load-properties"); +const node = require("devtools/client/shared/components/reps/object-inspector/utils/node"); const { nodeIsError, nodeIsPrimitive } = node; -const selection = require("./selection"); +const selection = require("devtools/client/shared/components/reps/object-inspector/utils/selection"); -const { MODE } = require("../../reps/constants"); +const { MODE } = require("devtools/client/shared/components/reps/reps/constants"); const { REPS: { Rep, Grip }, -} = require("../../reps/rep"); +} = require("devtools/client/shared/components/reps/reps/rep"); function shouldRenderRootsInReps(roots, props = {}) { if (roots.length !== 1) { diff --git a/devtools/client/shared/components/reps/object-inspector/utils/load-properties.js b/devtools/client/shared/components/reps/object-inspector/utils/load-properties.js index 28d6b789d3ae0..bdfe7bfaa875d 100644 --- a/devtools/client/shared/components/reps/object-inspector/utils/load-properties.js +++ b/devtools/client/shared/components/reps/object-inspector/utils/load-properties.js @@ -10,7 +10,7 @@ const { enumSymbols, getFullText, getProxySlots, -} = require("./client"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/client"); const { getClosestGripNode, @@ -27,7 +27,7 @@ const { nodeIsProxy, nodeNeedsNumericalBuckets, nodeIsLongString, -} = require("./node"); +} = require("devtools/client/shared/components/reps/object-inspector/utils/node"); function loadItemProperties(item, client, loadedProperties) { const gripItem = getClosestGripNode(item); diff --git a/devtools/client/shared/components/reps/object-inspector/utils/node.js b/devtools/client/shared/components/reps/object-inspector/utils/node.js index ff5eabda20fef..32cac562a9318 100644 --- a/devtools/client/shared/components/reps/object-inspector/utils/node.js +++ b/devtools/client/shared/components/reps/object-inspector/utils/node.js @@ -2,14 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { maybeEscapePropertyName } = require("../../reps/rep-utils"); -const ArrayRep = require("../../reps/array"); -const GripArrayRep = require("../../reps/grip-array"); -const GripMap = require("../../reps/grip-map"); -const GripMapEntryRep = require("../../reps/grip-map-entry"); -const ErrorRep = require("../../reps/error"); -const BigIntRep = require("../../reps/big-int"); -const { isLongString } = require("../../reps/string"); +const { maybeEscapePropertyName } = require("devtools/client/shared/components/reps/reps/rep-utils"); +const ArrayRep = require("devtools/client/shared/components/reps/reps/array"); +const GripArrayRep = require("devtools/client/shared/components/reps/reps/grip-array"); +const GripMap = require("devtools/client/shared/components/reps/reps/grip-map"); +const GripMapEntryRep = require("devtools/client/shared/components/reps/reps/grip-map-entry"); +const ErrorRep = require("devtools/client/shared/components/reps/reps/error"); +const BigIntRep = require("devtools/client/shared/components/reps/reps/big-int"); +const { isLongString } = require("devtools/client/shared/components/reps/reps/string"); const MAX_NUMERICAL_PROPERTIES = 100; diff --git a/devtools/client/shared/components/reps/reps/accessible.js b/devtools/client/shared/components/reps/reps/accessible.js index 2d1d11bb20eff..962e565ed4c13 100644 --- a/devtools/client/shared/components/reps/reps/accessible.js +++ b/devtools/client/shared/components/reps/reps/accessible.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { @@ -10,8 +12,13 @@ const { } = require("devtools/client/shared/vendor/react-dom-factories"); // Utils -const { isGrip, wrapRender } = require("./rep-utils"); -const { rep: StringRep } = require("./string"); +const { + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + rep: StringRep, +} = require("devtools/client/shared/components/reps/reps/string"); /** * Renders Accessible object. diff --git a/devtools/client/shared/components/reps/reps/accessor.js b/devtools/client/shared/components/reps/reps/accessor.js index 8d274ba954ab6..34d36fc05c2ee 100644 --- a/devtools/client/shared/components/reps/reps/accessor.js +++ b/devtools/client/shared/components/reps/reps/accessor.js @@ -2,14 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const { button, span, } = require("devtools/client/shared/vendor/react-dom-factories"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const { wrapRender } = require("./rep-utils"); -const { MODE } = require("./constants"); +const { + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); /** * Renders an object. An object is represented by a list of its @@ -31,7 +37,10 @@ function Accessor(props) { } = props; if (evaluation) { - const { Rep, Grip } = require("./rep"); + const { + Rep, + Grip, + } = require("devtools/client/shared/components/reps/reps/rep"); return span( { className: "objectBox objectBox-accessor objectTitle", diff --git a/devtools/client/shared/components/reps/reps/array.js b/devtools/client/shared/components/reps/reps/array.js index 17c4398d7a048..5f65c3ce5a0fd 100644 --- a/devtools/client/shared/components/reps/reps/array.js +++ b/devtools/client/shared/components/reps/reps/array.js @@ -2,11 +2,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const { span } = require("devtools/client/shared/vendor/react-dom-factories"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const { wrapRender } = require("./rep-utils"); -const { MODE } = require("./constants"); +const { + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const ModePropType = PropTypes.oneOf( // @TODO Change this to Object.values when supported in Node's version of V8 @@ -125,7 +131,7 @@ ItemRep.propTypes = { }; function ItemRep(props) { - const { Rep } = require("./rep"); + const { Rep } = require("devtools/client/shared/components/reps/reps/rep"); const { object, delim, mode } = props; return span( diff --git a/devtools/client/shared/components/reps/reps/attribute.js b/devtools/client/shared/components/reps/reps/attribute.js index a024bbcdde871..82f7fdd852a20 100644 --- a/devtools/client/shared/components/reps/reps/attribute.js +++ b/devtools/client/shared/components/reps/reps/attribute.js @@ -2,13 +2,21 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Reps -const { getGripType, isGrip, wrapRender } = require("./rep-utils"); -const { rep: StringRep } = require("./string"); +const { + getGripType, + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + rep: StringRep, +} = require("devtools/client/shared/components/reps/reps/string"); /** * Renders DOM attribute diff --git a/devtools/client/shared/components/reps/reps/big-int.js b/devtools/client/shared/components/reps/reps/big-int.js index 11128a33562e4..4736a0abe118a 100644 --- a/devtools/client/shared/components/reps/reps/big-int.js +++ b/devtools/client/shared/components/reps/reps/big-int.js @@ -2,11 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const { span } = require("devtools/client/shared/vendor/react-dom-factories"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const { getGripType, wrapRender } = require("./rep-utils"); +const { + getGripType, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a BigInt Number diff --git a/devtools/client/shared/components/reps/reps/caption.js b/devtools/client/shared/components/reps/reps/caption.js index 23d1005c286d7..cf3b5c98a453a 100644 --- a/devtools/client/shared/components/reps/reps/caption.js +++ b/devtools/client/shared/components/reps/reps/caption.js @@ -2,11 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { wrapRender } = require("./rep-utils"); +const { + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a caption. This template is used by other components diff --git a/devtools/client/shared/components/reps/reps/comment-node.js b/devtools/client/shared/components/reps/reps/comment-node.js index 12cc5e5cbe373..90d82a46c3afa 100644 --- a/devtools/client/shared/components/reps/reps/comment-node.js +++ b/devtools/client/shared/components/reps/reps/comment-node.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); @@ -10,9 +12,11 @@ const { cropString, cropMultipleLines, wrapRender, -} = require("./rep-utils"); -const { MODE } = require("./constants"); -const nodeConstants = require("../shared/dom-node-constants"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const nodeConstants = require("devtools/client/shared/components/reps/shared/dom-node-constants"); /** * Renders DOM comment node. diff --git a/devtools/client/shared/components/reps/reps/constants.js b/devtools/client/shared/components/reps/reps/constants.js index 2a96be42867b3..e880e8689482d 100644 --- a/devtools/client/shared/components/reps/reps/constants.js +++ b/devtools/client/shared/components/reps/reps/constants.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + module.exports = { MODE: { TINY: Symbol("TINY"), diff --git a/devtools/client/shared/components/reps/reps/date-time.js b/devtools/client/shared/components/reps/reps/date-time.js index a9a7cac309c59..df081c0242bcb 100644 --- a/devtools/client/shared/components/reps/reps/date-time.js +++ b/devtools/client/shared/components/reps/reps/date-time.js @@ -2,12 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Reps -const { getGripType, isGrip, wrapRender } = require("./rep-utils"); +const { + getGripType, + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Used to render JS built-in Date() object. diff --git a/devtools/client/shared/components/reps/reps/document-type.js b/devtools/client/shared/components/reps/reps/document-type.js index 1056073fc8a81..38c25c62ff5d9 100644 --- a/devtools/client/shared/components/reps/reps/document-type.js +++ b/devtools/client/shared/components/reps/reps/document-type.js @@ -2,12 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Reps -const { getGripType, isGrip, wrapRender } = require("./rep-utils"); +const { + getGripType, + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders DOM documentType object. diff --git a/devtools/client/shared/components/reps/reps/document.js b/devtools/client/shared/components/reps/reps/document.js index c4b0cfa5f1f25..6b1b09a22d336 100644 --- a/devtools/client/shared/components/reps/reps/document.js +++ b/devtools/client/shared/components/reps/reps/document.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); @@ -12,7 +14,7 @@ const { isGrip, getURLDisplayString, wrapRender, -} = require("./rep-utils"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders DOM document object. diff --git a/devtools/client/shared/components/reps/reps/element-node.js b/devtools/client/shared/components/reps/reps/element-node.js index 871ac96a65768..94759b90547f5 100644 --- a/devtools/client/shared/components/reps/reps/element-node.js +++ b/devtools/client/shared/components/reps/reps/element-node.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const { button, @@ -10,9 +12,17 @@ const { const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); // Utils -const { isGrip, wrapRender } = require("./rep-utils"); -const { rep: StringRep, isLongString } = require("./string"); -const { MODE } = require("./constants"); +const { + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + rep: StringRep, + isLongString, +} = require("devtools/client/shared/components/reps/reps/string"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const nodeConstants = require("devtools/shared/dom-node-constants"); const MAX_ATTRIBUTE_LENGTH = 50; diff --git a/devtools/client/shared/components/reps/reps/error.js b/devtools/client/shared/components/reps/reps/error.js index 04d852809b316..fe25294ce5c71 100644 --- a/devtools/client/shared/components/reps/reps/error.js +++ b/devtools/client/shared/components/reps/reps/error.js @@ -2,15 +2,26 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Utils -const { isGrip, wrapRender } = require("./rep-utils"); -const { cleanFunctionName } = require("./function"); -const { isLongString } = require("./string"); -const { MODE } = require("./constants"); +const { + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + cleanFunctionName, +} = require("devtools/client/shared/components/reps/reps/function"); +const { + isLongString, +} = require("devtools/client/shared/components/reps/reps/string"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const IGNORED_SOURCE_URLS = ["debugger eval code"]; @@ -77,7 +88,7 @@ function ErrorRep(props) { } if (mode !== MODE.TINY) { - const { Rep } = require("./rep"); + const { Rep } = require("devtools/client/shared/components/reps/reps/rep"); content.push( Rep({ ...props, diff --git a/devtools/client/shared/components/reps/reps/event.js b/devtools/client/shared/components/reps/reps/event.js index 630bc135d3ee9..95b80532458cc 100644 --- a/devtools/client/shared/components/reps/reps/event.js +++ b/devtools/client/shared/components/reps/reps/event.js @@ -2,14 +2,21 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); // Reps -const { isGrip, wrapRender } = require("./rep-utils"); +const { + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); -const { MODE } = require("./constants"); -const { rep } = require("./grip"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { rep } = require("devtools/client/shared/components/reps/reps/grip"); /** * Renders DOM event objects. diff --git a/devtools/client/shared/components/reps/reps/function.js b/devtools/client/shared/components/reps/reps/function.js index 05ba16539fec0..65f17403c4cf5 100644 --- a/devtools/client/shared/components/reps/reps/function.js +++ b/devtools/client/shared/components/reps/reps/function.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { @@ -10,8 +12,15 @@ const { } = require("devtools/client/shared/vendor/react-dom-factories"); // Reps -const { getGripType, isGrip, cropString, wrapRender } = require("./rep-utils"); -const { MODE } = require("./constants"); +const { + getGripType, + isGrip, + cropString, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const IGNORED_SOURCE_URLS = ["debugger eval code"]; diff --git a/devtools/client/shared/components/reps/reps/grip-array.js b/devtools/client/shared/components/reps/reps/grip-array.js index 0ff3f911b3b1d..fa865a3ffeabc 100644 --- a/devtools/client/shared/components/reps/reps/grip-array.js +++ b/devtools/client/shared/components/reps/reps/grip-array.js @@ -2,21 +2,29 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { lengthBubble } = require("../shared/grip-length-bubble"); +const { + lengthBubble, +} = require("devtools/client/shared/components/reps/shared/grip-length-bubble"); const { interleave, getGripType, isGrip, wrapRender, ellipsisElement, -} = require("./rep-utils"); -const { MODE } = require("./constants"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); -const { ModePropType } = require("./array"); +const { + ModePropType, +} = require("devtools/client/shared/components/reps/reps/array"); const DEFAULT_TITLE = "Array"; /** @@ -157,7 +165,7 @@ function getPreviewItems(grip) { } function arrayIterator(props, grip, max) { - const { Rep } = require("./rep"); + const { Rep } = require("devtools/client/shared/components/reps/reps/rep"); let items = []; const gripLength = getLength(grip); diff --git a/devtools/client/shared/components/reps/reps/grip-map-entry.js b/devtools/client/shared/components/reps/reps/grip-map-entry.js index 80496e81d2000..d18144d2ec85f 100644 --- a/devtools/client/shared/components/reps/reps/grip-map-entry.js +++ b/devtools/client/shared/components/reps/reps/grip-map-entry.js @@ -2,13 +2,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Utils -const { wrapRender } = require("./rep-utils"); -const PropRep = require("./prop-rep"); -const { MODE } = require("./constants"); +const { + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const PropRep = require("devtools/client/shared/components/reps/reps/prop-rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); /** * Renders an map entry. A map entry is represented by its key, * a column and its value. diff --git a/devtools/client/shared/components/reps/reps/grip-map.js b/devtools/client/shared/components/reps/reps/grip-map.js index 028cffedafefc..1458d33a672dc 100644 --- a/devtools/client/shared/components/reps/reps/grip-map.js +++ b/devtools/client/shared/components/reps/reps/grip-map.js @@ -2,20 +2,28 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { lengthBubble } = require("../shared/grip-length-bubble"); +const { + lengthBubble, +} = require("devtools/client/shared/components/reps/shared/grip-length-bubble"); const { interleave, isGrip, wrapRender, ellipsisElement, -} = require("./rep-utils"); -const PropRep = require("./prop-rep"); -const { MODE } = require("./constants"); -const { ModePropType } = require("./array"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const PropRep = require("devtools/client/shared/components/reps/reps/prop-rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + ModePropType, +} = require("devtools/client/shared/components/reps/reps/array"); /** * Renders an map. A map is represented by a list of its diff --git a/devtools/client/shared/components/reps/reps/grip.js b/devtools/client/shared/components/reps/reps/grip.js index ab97e590b1a41..cd4c098cb2e99 100644 --- a/devtools/client/shared/components/reps/reps/grip.js +++ b/devtools/client/shared/components/reps/reps/grip.js @@ -2,14 +2,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Dependencies -const { interleave, isGrip, wrapRender } = require("./rep-utils"); -const PropRep = require("./prop-rep"); -const { MODE } = require("./constants"); +const { + interleave, + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const PropRep = require("devtools/client/shared/components/reps/reps/prop-rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); /** * Renders generic grip. Grip is client representation @@ -142,7 +150,7 @@ function safePropIterator(props, object, max) { function propIterator(props, object, max) { if (object.preview && Object.keys(object.preview).includes("wrappedValue")) { - const { Rep } = require("./rep"); + const { Rep } = require("devtools/client/shared/components/reps/reps/rep"); return [ Rep({ diff --git a/devtools/client/shared/components/reps/reps/infinity.js b/devtools/client/shared/components/reps/reps/infinity.js index ff6f99446ea6a..76f1ff0c3061a 100644 --- a/devtools/client/shared/components/reps/reps/infinity.js +++ b/devtools/client/shared/components/reps/reps/infinity.js @@ -2,11 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { getGripType, wrapRender } = require("./rep-utils"); +const { + getGripType, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a Infinity object diff --git a/devtools/client/shared/components/reps/reps/nan.js b/devtools/client/shared/components/reps/reps/nan.js index 712db7635408f..a6dc50988a83b 100644 --- a/devtools/client/shared/components/reps/reps/nan.js +++ b/devtools/client/shared/components/reps/reps/nan.js @@ -2,12 +2,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const { span } = require("devtools/client/shared/vendor/react-dom-factories"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const { getGripType, wrapRender } = require("./rep-utils"); +const { + getGripType, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a NaN object diff --git a/devtools/client/shared/components/reps/reps/null.js b/devtools/client/shared/components/reps/reps/null.js index 5b6227714fe62..b108a10d8772f 100644 --- a/devtools/client/shared/components/reps/reps/null.js +++ b/devtools/client/shared/components/reps/reps/null.js @@ -2,12 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const { span } = require("devtools/client/shared/vendor/react-dom-factories"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const { wrapRender } = require("./rep-utils"); +const { + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders null value diff --git a/devtools/client/shared/components/reps/reps/number.js b/devtools/client/shared/components/reps/reps/number.js index c6a7e1a71292c..d4583bf3ae1e0 100644 --- a/devtools/client/shared/components/reps/reps/number.js +++ b/devtools/client/shared/components/reps/reps/number.js @@ -2,11 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { getGripType, wrapRender } = require("./rep-utils"); +const { + getGripType, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a number diff --git a/devtools/client/shared/components/reps/reps/object-with-text.js b/devtools/client/shared/components/reps/reps/object-with-text.js index 4f7856248bca8..dbb2482bdaaac 100644 --- a/devtools/client/shared/components/reps/reps/object-with-text.js +++ b/devtools/client/shared/components/reps/reps/object-with-text.js @@ -2,14 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Reps -const { isGrip, wrapRender } = require("./rep-utils"); +const { + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); -const String = require("./string").rep; +const String = require("devtools/client/shared/components/reps/reps/string") + .rep; /** * Renders a grip object with textual data. diff --git a/devtools/client/shared/components/reps/reps/object-with-url.js b/devtools/client/shared/components/reps/reps/object-with-url.js index 5433101fa84b1..1c74ed1a2ab94 100644 --- a/devtools/client/shared/components/reps/reps/object-with-url.js +++ b/devtools/client/shared/components/reps/reps/object-with-url.js @@ -2,12 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Reps -const { isGrip, getURLDisplayString, wrapRender } = require("./rep-utils"); +const { + isGrip, + getURLDisplayString, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a grip object with URL data. diff --git a/devtools/client/shared/components/reps/reps/object.js b/devtools/client/shared/components/reps/reps/object.js index cd768da149aaf..f63153412484d 100644 --- a/devtools/client/shared/components/reps/reps/object.js +++ b/devtools/client/shared/components/reps/reps/object.js @@ -2,13 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { wrapRender, ellipsisElement } = require("./rep-utils"); -const PropRep = require("./prop-rep"); -const { MODE } = require("./constants"); +const { + wrapRender, + ellipsisElement, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const PropRep = require("devtools/client/shared/components/reps/reps/prop-rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const DEFAULT_TITLE = "Object"; diff --git a/devtools/client/shared/components/reps/reps/promise.js b/devtools/client/shared/components/reps/reps/promise.js index 6dfbbe24b2d9c..df1bdfa90aa8a 100644 --- a/devtools/client/shared/components/reps/reps/promise.js +++ b/devtools/client/shared/components/reps/reps/promise.js @@ -2,15 +2,23 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Dependencies -const { getGripType, isGrip, wrapRender } = require("./rep-utils"); +const { + getGripType, + isGrip, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); -const PropRep = require("./prop-rep"); -const { MODE } = require("./constants"); +const PropRep = require("devtools/client/shared/components/reps/reps/prop-rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); /** * Renders a DOM Promise object. @@ -38,7 +46,7 @@ function PromiseRep(props) { }; if (props.mode === MODE.TINY) { - const { Rep } = require("./rep"); + const { Rep } = require("devtools/client/shared/components/reps/reps/rep"); return span( config, diff --git a/devtools/client/shared/components/reps/reps/prop-rep.js b/devtools/client/shared/components/reps/reps/prop-rep.js index e4bdae8dca411..1a1d8d1df9489 100644 --- a/devtools/client/shared/components/reps/reps/prop-rep.js +++ b/devtools/client/shared/components/reps/reps/prop-rep.js @@ -2,12 +2,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { maybeEscapePropertyName, wrapRender } = require("./rep-utils"); -const { MODE } = require("./constants"); +const { + maybeEscapePropertyName, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); /** * Property for Obj (local JS objects), Grip (remote JS objects) @@ -40,8 +47,8 @@ PropRep.propTypes = { */ function PropRep(props) { - const Grip = require("./grip"); - const { Rep } = require("./rep"); + const Grip = require("devtools/client/shared/components/reps/reps/grip"); + const { Rep } = require("devtools/client/shared/components/reps/reps/rep"); const shouldRenderTooltip = props.shouldRenderTooltip; let { name, mode, equal, suppressQuotes } = props; diff --git a/devtools/client/shared/components/reps/reps/regexp.js b/devtools/client/shared/components/reps/reps/regexp.js index 92e7f38b66791..6aaca296a33aa 100644 --- a/devtools/client/shared/components/reps/reps/regexp.js +++ b/devtools/client/shared/components/reps/reps/regexp.js @@ -2,12 +2,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); // Reps -const { getGripType, isGrip, wrapRender, ELLIPSIS } = require("./rep-utils"); +const { + getGripType, + isGrip, + wrapRender, + ELLIPSIS, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a grip object with regular expression. diff --git a/devtools/client/shared/components/reps/reps/rep-utils.js b/devtools/client/shared/components/reps/reps/rep-utils.js index 2b266ec30d9e7..57e55bcb04149 100644 --- a/devtools/client/shared/components/reps/reps/rep-utils.js +++ b/devtools/client/shared/components/reps/reps/rep-utils.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const validProtocols = /(http|https|ftp|data|resource|chrome):/i; diff --git a/devtools/client/shared/components/reps/reps/rep.js b/devtools/client/shared/components/reps/reps/rep.js index 224fff5c04334..e5c83a55fac44 100644 --- a/devtools/client/shared/components/reps/reps/rep.js +++ b/devtools/client/shared/components/reps/reps/rep.js @@ -2,41 +2,43 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Load all existing rep templates -const Undefined = require("./undefined"); -const Null = require("./null"); -const StringRep = require("./string"); -const Number = require("./number"); -const ArrayRep = require("./array"); -const Obj = require("./object"); -const SymbolRep = require("./symbol"); -const InfinityRep = require("./infinity"); -const NaNRep = require("./nan"); -const Accessor = require("./accessor"); +const Undefined = require("devtools/client/shared/components/reps/reps/undefined"); +const Null = require("devtools/client/shared/components/reps/reps/null"); +const StringRep = require("devtools/client/shared/components/reps/reps/string"); +const Number = require("devtools/client/shared/components/reps/reps/number"); +const ArrayRep = require("devtools/client/shared/components/reps/reps/array"); +const Obj = require("devtools/client/shared/components/reps/reps/object"); +const SymbolRep = require("devtools/client/shared/components/reps/reps/symbol"); +const InfinityRep = require("devtools/client/shared/components/reps/reps/infinity"); +const NaNRep = require("devtools/client/shared/components/reps/reps/nan"); +const Accessor = require("devtools/client/shared/components/reps/reps/accessor"); // DOM types (grips) -const Accessible = require("./accessible"); -const Attribute = require("./attribute"); -const BigInt = require("./big-int"); -const DateTime = require("./date-time"); -const Document = require("./document"); -const DocumentType = require("./document-type"); -const Event = require("./event"); -const Func = require("./function"); -const PromiseRep = require("./promise"); -const RegExp = require("./regexp"); -const StyleSheet = require("./stylesheet"); -const CommentNode = require("./comment-node"); -const ElementNode = require("./element-node"); -const TextNode = require("./text-node"); -const ErrorRep = require("./error"); -const Window = require("./window"); -const ObjectWithText = require("./object-with-text"); -const ObjectWithURL = require("./object-with-url"); -const GripArray = require("./grip-array"); -const GripMap = require("./grip-map"); -const GripMapEntry = require("./grip-map-entry"); -const Grip = require("./grip"); +const Accessible = require("devtools/client/shared/components/reps/reps/accessible"); +const Attribute = require("devtools/client/shared/components/reps/reps/attribute"); +const BigInt = require("devtools/client/shared/components/reps/reps/big-int"); +const DateTime = require("devtools/client/shared/components/reps/reps/date-time"); +const Document = require("devtools/client/shared/components/reps/reps/document"); +const DocumentType = require("devtools/client/shared/components/reps/reps/document-type"); +const Event = require("devtools/client/shared/components/reps/reps/event"); +const Func = require("devtools/client/shared/components/reps/reps/function"); +const PromiseRep = require("devtools/client/shared/components/reps/reps/promise"); +const RegExp = require("devtools/client/shared/components/reps/reps/regexp"); +const StyleSheet = require("devtools/client/shared/components/reps/reps/stylesheet"); +const CommentNode = require("devtools/client/shared/components/reps/reps/comment-node"); +const ElementNode = require("devtools/client/shared/components/reps/reps/element-node"); +const TextNode = require("devtools/client/shared/components/reps/reps/text-node"); +const ErrorRep = require("devtools/client/shared/components/reps/reps/error"); +const Window = require("devtools/client/shared/components/reps/reps/window"); +const ObjectWithText = require("devtools/client/shared/components/reps/reps/object-with-text"); +const ObjectWithURL = require("devtools/client/shared/components/reps/reps/object-with-url"); +const GripArray = require("devtools/client/shared/components/reps/reps/grip-array"); +const GripMap = require("devtools/client/shared/components/reps/reps/grip-map"); +const GripMapEntry = require("devtools/client/shared/components/reps/reps/grip-map-entry"); +const Grip = require("devtools/client/shared/components/reps/reps/grip"); // List of all registered template. // XXX there should be a way for extensions to register a new diff --git a/devtools/client/shared/components/reps/reps/string.js b/devtools/client/shared/components/reps/reps/string.js index 40aa033dd2894..ba8f4b7ac6d53 100644 --- a/devtools/client/shared/components/reps/reps/string.js +++ b/devtools/client/shared/components/reps/reps/string.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const { a, @@ -19,7 +21,7 @@ const { ELLIPSIS, uneatLastUrlCharsRegex, urlRegex, -} = require("./rep-utils"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a string. String value is enclosed within quotes. diff --git a/devtools/client/shared/components/reps/reps/stubs/accessible.js b/devtools/client/shared/components/reps/reps/stubs/accessible.js index 8f2a51f5cae48..3c9834e6d342b 100644 --- a/devtools/client/shared/components/reps/reps/stubs/accessible.js +++ b/devtools/client/shared/components/reps/reps/stubs/accessible.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Document", { actor: "server1.conn1.child1/accessible31", diff --git a/devtools/client/shared/components/reps/reps/stubs/accessor.js b/devtools/client/shared/components/reps/reps/stubs/accessor.js index 8bc9978acf1ff..cee4a836ceb79 100644 --- a/devtools/client/shared/components/reps/reps/stubs/accessor.js +++ b/devtools/client/shared/components/reps/reps/stubs/accessor.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("getter", { diff --git a/devtools/client/shared/components/reps/reps/stubs/attribute.js b/devtools/client/shared/components/reps/reps/stubs/attribute.js index ea65da0726ef2..d0a9b53fec5a6 100644 --- a/devtools/client/shared/components/reps/reps/stubs/attribute.js +++ b/devtools/client/shared/components/reps/reps/stubs/attribute.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Attribute", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/big-int.js b/devtools/client/shared/components/reps/reps/stubs/big-int.js index e458336d1aae9..41042bdeb674e 100644 --- a/devtools/client/shared/components/reps/reps/stubs/big-int.js +++ b/devtools/client/shared/components/reps/reps/stubs/big-int.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("1n", { type: "BigInt", diff --git a/devtools/client/shared/components/reps/reps/stubs/comment-node.js b/devtools/client/shared/components/reps/reps/stubs/comment-node.js index 8f6c4bad5679a..e83a489150aff 100644 --- a/devtools/client/shared/components/reps/reps/stubs/comment-node.js +++ b/devtools/client/shared/components/reps/reps/stubs/comment-node.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Comment", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/date-time.js b/devtools/client/shared/components/reps/reps/stubs/date-time.js index d706f7e310ca9..ed78b690c8571 100644 --- a/devtools/client/shared/components/reps/reps/stubs/date-time.js +++ b/devtools/client/shared/components/reps/reps/stubs/date-time.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("DateTime", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/document-type.js b/devtools/client/shared/components/reps/reps/stubs/document-type.js index 9ad79ea62b7f3..a499670b58fa5 100644 --- a/devtools/client/shared/components/reps/reps/stubs/document-type.js +++ b/devtools/client/shared/components/reps/reps/stubs/document-type.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("html", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/document.js b/devtools/client/shared/components/reps/reps/stubs/document.js index 9a898c0dc25db..555bbff2d1764 100644 --- a/devtools/client/shared/components/reps/reps/stubs/document.js +++ b/devtools/client/shared/components/reps/reps/stubs/document.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Document", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/element-node.js b/devtools/client/shared/components/reps/reps/stubs/element-node.js index ad0c4706998c9..b0b4369b3cffc 100644 --- a/devtools/client/shared/components/reps/reps/stubs/element-node.js +++ b/devtools/client/shared/components/reps/reps/stubs/element-node.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("BodyNode", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/error.js b/devtools/client/shared/components/reps/reps/stubs/error.js index 18fa3c3907027..6d45286218af1 100644 --- a/devtools/client/shared/components/reps/reps/stubs/error.js +++ b/devtools/client/shared/components/reps/reps/stubs/error.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("SimpleError", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/event.js b/devtools/client/shared/components/reps/reps/stubs/event.js index 4416277aa3894..c0c49c5e4209e 100644 --- a/devtools/client/shared/components/reps/reps/stubs/event.js +++ b/devtools/client/shared/components/reps/reps/stubs/event.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("testEvent", { diff --git a/devtools/client/shared/components/reps/reps/stubs/failure.js b/devtools/client/shared/components/reps/reps/stubs/failure.js index b8d69140e47d1..f839d5eab5662 100644 --- a/devtools/client/shared/components/reps/reps/stubs/failure.js +++ b/devtools/client/shared/components/reps/reps/stubs/failure.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Failure", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/function.js b/devtools/client/shared/components/reps/reps/stubs/function.js index f0d4d3d127abc..a0ba6ddf8d4bf 100644 --- a/devtools/client/shared/components/reps/reps/stubs/function.js +++ b/devtools/client/shared/components/reps/reps/stubs/function.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Named", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/grip-array.js b/devtools/client/shared/components/reps/reps/stubs/grip-array.js index 327cc823c8555..108e3218845e7 100644 --- a/devtools/client/shared/components/reps/reps/stubs/grip-array.js +++ b/devtools/client/shared/components/reps/reps/stubs/grip-array.js @@ -2,8 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { MODE } = require("../constants"); -const { maxLengthMap } = require("../grip-array"); +"use strict"; + +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + maxLengthMap, +} = require("devtools/client/shared/components/reps/reps/grip-array"); const stubs = new Map(); stubs.set("testBasic", { diff --git a/devtools/client/shared/components/reps/reps/stubs/grip-map-entry.js b/devtools/client/shared/components/reps/reps/stubs/grip-map-entry.js index fdf0c86d27166..6c21389845472 100644 --- a/devtools/client/shared/components/reps/reps/stubs/grip-map-entry.js +++ b/devtools/client/shared/components/reps/reps/stubs/grip-map-entry.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("A → 0", { type: "mapEntry", diff --git a/devtools/client/shared/components/reps/reps/stubs/grip-map.js b/devtools/client/shared/components/reps/reps/stubs/grip-map.js index cb330a3eb88d8..a123d573b838f 100644 --- a/devtools/client/shared/components/reps/reps/stubs/grip-map.js +++ b/devtools/client/shared/components/reps/reps/stubs/grip-map.js @@ -2,8 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { MODE } = require("../constants"); -const { maxLengthMap } = require("../grip-map"); +"use strict"; + +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + maxLengthMap, +} = require("devtools/client/shared/components/reps/reps/grip-map"); const stubs = new Map(); diff --git a/devtools/client/shared/components/reps/reps/stubs/grip.js b/devtools/client/shared/components/reps/reps/stubs/grip.js index 923a1baa27c92..ab9563cf6bc0f 100644 --- a/devtools/client/shared/components/reps/reps/stubs/grip.js +++ b/devtools/client/shared/components/reps/reps/stubs/grip.js @@ -2,8 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { MODE } = require("../constants"); -const { maxLengthMap } = require("../grip"); +"use strict"; + +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + maxLengthMap, +} = require("devtools/client/shared/components/reps/reps/grip"); const stubs = new Map(); diff --git a/devtools/client/shared/components/reps/reps/stubs/infinity.js b/devtools/client/shared/components/reps/reps/stubs/infinity.js index 0d94a0db86fa7..b7483f4ea85ee 100644 --- a/devtools/client/shared/components/reps/reps/stubs/infinity.js +++ b/devtools/client/shared/components/reps/reps/stubs/infinity.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Infinity", { type: "Infinity", diff --git a/devtools/client/shared/components/reps/reps/stubs/long-string.js b/devtools/client/shared/components/reps/reps/stubs/long-string.js index 6eab3ffb2e5cf..26715c4017fcf 100644 --- a/devtools/client/shared/components/reps/reps/stubs/long-string.js +++ b/devtools/client/shared/components/reps/reps/stubs/long-string.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const multilineFullText = `a\n${Array(20000) .fill("a") .join("")}`; diff --git a/devtools/client/shared/components/reps/reps/stubs/nan.js b/devtools/client/shared/components/reps/reps/stubs/nan.js index 8ed81bddb096e..67d188022e235 100644 --- a/devtools/client/shared/components/reps/reps/stubs/nan.js +++ b/devtools/client/shared/components/reps/reps/stubs/nan.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("NaN", { type: "NaN", diff --git a/devtools/client/shared/components/reps/reps/stubs/null.js b/devtools/client/shared/components/reps/reps/stubs/null.js index 5d8ca76976480..20b9985e000a5 100644 --- a/devtools/client/shared/components/reps/reps/stubs/null.js +++ b/devtools/client/shared/components/reps/reps/stubs/null.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Null", { type: "null", diff --git a/devtools/client/shared/components/reps/reps/stubs/number.js b/devtools/client/shared/components/reps/reps/stubs/number.js index 3e58088868a3d..adbb803f4ae86 100644 --- a/devtools/client/shared/components/reps/reps/stubs/number.js +++ b/devtools/client/shared/components/reps/reps/stubs/number.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Int", 5); stubs.set("True", true); diff --git a/devtools/client/shared/components/reps/reps/stubs/object-with-text.js b/devtools/client/shared/components/reps/reps/stubs/object-with-text.js index 2639ab6120a33..ea17d01d7e4a5 100644 --- a/devtools/client/shared/components/reps/reps/stubs/object-with-text.js +++ b/devtools/client/shared/components/reps/reps/stubs/object-with-text.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("ShadowRule", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/object-with-url.js b/devtools/client/shared/components/reps/reps/stubs/object-with-url.js index d4dc979a28b1b..179faf08749d7 100644 --- a/devtools/client/shared/components/reps/reps/stubs/object-with-url.js +++ b/devtools/client/shared/components/reps/reps/stubs/object-with-url.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("ObjectWithUrl", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/promise.js b/devtools/client/shared/components/reps/reps/stubs/promise.js index cea025b9a4436..0f87daa0e92de 100644 --- a/devtools/client/shared/components/reps/reps/stubs/promise.js +++ b/devtools/client/shared/components/reps/reps/stubs/promise.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Pending", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/regexp.js b/devtools/client/shared/components/reps/reps/stubs/regexp.js index f436e7bb98deb..0dd5b06e97d00 100644 --- a/devtools/client/shared/components/reps/reps/stubs/regexp.js +++ b/devtools/client/shared/components/reps/reps/stubs/regexp.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("RegExp", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/stylesheet.js b/devtools/client/shared/components/reps/reps/stubs/stylesheet.js index d8038677d7205..ef22424937bee 100644 --- a/devtools/client/shared/components/reps/reps/stubs/stylesheet.js +++ b/devtools/client/shared/components/reps/reps/stubs/stylesheet.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("StyleSheet", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stubs/symbol.js b/devtools/client/shared/components/reps/reps/stubs/symbol.js index 22afe88505dd2..de08a1b580f66 100644 --- a/devtools/client/shared/components/reps/reps/stubs/symbol.js +++ b/devtools/client/shared/components/reps/reps/stubs/symbol.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Symbol", { type: "symbol", diff --git a/devtools/client/shared/components/reps/reps/stubs/text-node.js b/devtools/client/shared/components/reps/reps/stubs/text-node.js index 7abddad61115a..a958eb476ac6c 100644 --- a/devtools/client/shared/components/reps/reps/stubs/text-node.js +++ b/devtools/client/shared/components/reps/reps/stubs/text-node.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("testRendering", { class: "Text", diff --git a/devtools/client/shared/components/reps/reps/stubs/undefined.js b/devtools/client/shared/components/reps/reps/stubs/undefined.js index 0c1173c844f88..f07d62db712e6 100644 --- a/devtools/client/shared/components/reps/reps/stubs/undefined.js +++ b/devtools/client/shared/components/reps/reps/stubs/undefined.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Undefined", { type: "undefined", diff --git a/devtools/client/shared/components/reps/reps/stubs/window.js b/devtools/client/shared/components/reps/reps/stubs/window.js index 74033e9c79c6f..d5cbacc0657bd 100644 --- a/devtools/client/shared/components/reps/reps/stubs/window.js +++ b/devtools/client/shared/components/reps/reps/stubs/window.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const stubs = new Map(); stubs.set("Window", { type: "object", diff --git a/devtools/client/shared/components/reps/reps/stylesheet.js b/devtools/client/shared/components/reps/reps/stylesheet.js index fa8db71833981..5ef15c8a0cd62 100644 --- a/devtools/client/shared/components/reps/reps/stylesheet.js +++ b/devtools/client/shared/components/reps/reps/stylesheet.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); @@ -12,7 +14,7 @@ const { isGrip, getURLDisplayString, wrapRender, -} = require("./rep-utils"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders a grip representing CSSStyleSheet diff --git a/devtools/client/shared/components/reps/reps/symbol.js b/devtools/client/shared/components/reps/reps/symbol.js index d51f03684a703..935604ac9c7dc 100644 --- a/devtools/client/shared/components/reps/reps/symbol.js +++ b/devtools/client/shared/components/reps/reps/symbol.js @@ -2,13 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); -const { getGripType, wrapRender } = require("./rep-utils"); +const { + getGripType, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); -const { rep: StringRep } = require("./string"); +const { + rep: StringRep, +} = require("devtools/client/shared/components/reps/reps/string"); const MAX_STRING_LENGTH = 50; diff --git a/devtools/client/shared/components/reps/reps/tests/.eslintrc.js b/devtools/client/shared/components/reps/reps/tests/.eslintrc.js new file mode 100644 index 0000000000000..ffb3e70473bc8 --- /dev/null +++ b/devtools/client/shared/components/reps/reps/tests/.eslintrc.js @@ -0,0 +1,10 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + env: { + jest: true, + }, +}; diff --git a/devtools/client/shared/components/reps/reps/tests/accessible.js b/devtools/client/shared/components/reps/reps/tests/accessible.js index 292feb93196b9..c768fdc6311a8 100644 --- a/devtools/client/shared/components/reps/reps/tests/accessible.js +++ b/devtools/client/shared/components/reps/reps/tests/accessible.js @@ -2,13 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -/* global jest */ +"use strict"; + +/* global jest, __dirname */ const { mount, shallow } = require("enzyme"); const { JSDOM } = require("jsdom"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Accessible } = REPS; -const { ELLIPSIS } = require("../rep-utils"); -const stubs = require("../stubs/accessible"); +const { + ELLIPSIS, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/accessible"); describe("Accessible - Document", () => { const stub = stubs.get("Document"); diff --git a/devtools/client/shared/components/reps/reps/tests/accessor.js b/devtools/client/shared/components/reps/reps/tests/accessor.js index 3c69fad657fa4..ee9609629f2d8 100644 --- a/devtools/client/shared/components/reps/reps/tests/accessor.js +++ b/devtools/client/shared/components/reps/reps/tests/accessor.js @@ -2,13 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Accessor, Rep } = REPS; -const stubs = require("../stubs/accessor"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/accessor"); describe("Accessor - getter", () => { const object = stubs.get("getter"); diff --git a/devtools/client/shared/components/reps/reps/tests/array.js b/devtools/client/shared/components/reps/reps/tests/array.js index 605a99671e81c..10c90b52d415a 100644 --- a/devtools/client/shared/components/reps/reps/tests/array.js +++ b/devtools/client/shared/components/reps/reps/tests/array.js @@ -2,11 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { MODE } = require("../constants"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const { ArrayRep, Rep } = REPS; const { maxLengthMap } = ArrayRep; diff --git a/devtools/client/shared/components/reps/reps/tests/attribute.js b/devtools/client/shared/components/reps/reps/tests/attribute.js index 0d5d537837b43..ead478bfb4884 100644 --- a/devtools/client/shared/components/reps/reps/tests/attribute.js +++ b/devtools/client/shared/components/reps/reps/tests/attribute.js @@ -2,15 +2,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { Attribute, Rep } = REPS; -const stubs = require("../stubs/attribute"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/attribute"); describe("Attribute", () => { const stub = stubs.get("Attribute"); diff --git a/devtools/client/shared/components/reps/reps/tests/big-int.js b/devtools/client/shared/components/reps/reps/tests/big-int.js index 6cc54d865cec8..b6b415b55eb01 100644 --- a/devtools/client/shared/components/reps/reps/tests/big-int.js +++ b/devtools/client/shared/components/reps/reps/tests/big-int.js @@ -2,10 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { BigInt, Rep } = REPS; -const stubs = require("../stubs/big-int"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/big-int"); describe("BigInt", () => { describe("1n", () => { diff --git a/devtools/client/shared/components/reps/reps/tests/comment-node.js b/devtools/client/shared/components/reps/reps/tests/comment-node.js index bfa37fc7c1a70..98f49938f51bf 100644 --- a/devtools/client/shared/components/reps/reps/tests/comment-node.js +++ b/devtools/client/shared/components/reps/reps/tests/comment-node.js @@ -2,15 +2,24 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); -const { MODE } = require("../constants"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const { Rep, CommentNode } = REPS; -const stubs = require("../stubs/comment-node"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/comment-node"); describe("CommentNode", () => { const stub = stubs.get("Comment"); diff --git a/devtools/client/shared/components/reps/reps/tests/date-time.js b/devtools/client/shared/components/reps/reps/tests/date-time.js index 38774521ae18c..3ce798be43c12 100644 --- a/devtools/client/shared/components/reps/reps/tests/date-time.js +++ b/devtools/client/shared/components/reps/reps/tests/date-time.js @@ -2,15 +2,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { DateTime, Rep } = REPS; -const stubs = require("../stubs/date-time"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/date-time"); describe("test DateTime", () => { const stub = stubs.get("DateTime"); diff --git a/devtools/client/shared/components/reps/reps/tests/document-type.js b/devtools/client/shared/components/reps/reps/tests/document-type.js index 2f6962f3b8182..b40e7b5ebc143 100644 --- a/devtools/client/shared/components/reps/reps/tests/document-type.js +++ b/devtools/client/shared/components/reps/reps/tests/document-type.js @@ -2,13 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { DocumentType } = REPS; -const stubs = require("../stubs/document-type"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/document-type"); describe("DocumentType", () => { const stub = stubs.get("html"); diff --git a/devtools/client/shared/components/reps/reps/tests/document.js b/devtools/client/shared/components/reps/reps/tests/document.js index b0ac6678b3b9a..058169993b807 100644 --- a/devtools/client/shared/components/reps/reps/tests/document.js +++ b/devtools/client/shared/components/reps/reps/tests/document.js @@ -2,13 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { Document } = REPS; -const stubs = require("../stubs/document"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/document"); describe("Document", () => { const stub = stubs.get("Document"); diff --git a/devtools/client/shared/components/reps/reps/tests/element-node.js b/devtools/client/shared/components/reps/reps/tests/element-node.js index 6024287424561..f6cb3089a5654 100644 --- a/devtools/client/shared/components/reps/reps/tests/element-node.js +++ b/devtools/client/shared/components/reps/reps/tests/element-node.js @@ -2,19 +2,30 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -/* global jest */ +"use strict"; + +/* global jest, __dirname */ const { mount, shallow } = require("enzyme"); const { JSDOM } = require("jsdom"); -const { REPS, getRep } = require("../rep"); -const { MODE } = require("../constants"); -const { MAX_ATTRIBUTE_LENGTH } = require("../element-node"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + MAX_ATTRIBUTE_LENGTH, +} = require("devtools/client/shared/components/reps/reps/element-node"); const { ElementNode } = REPS; const { expectActorAttribute, getSelectableInInspectorGrips, -} = require("./test-helpers"); -const { ELLIPSIS } = require("../rep-utils"); -const stubs = require("../stubs/element-node"); +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); +const { + ELLIPSIS, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/element-node"); describe("ElementNode - BodyNode", () => { const stub = stubs.get("BodyNode"); diff --git a/devtools/client/shared/components/reps/reps/tests/error.js b/devtools/client/shared/components/reps/reps/tests/error.js index 84c27e30da651..5d8b4b4acf428 100644 --- a/devtools/client/shared/components/reps/reps/tests/error.js +++ b/devtools/client/shared/components/reps/reps/tests/error.js @@ -2,15 +2,24 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { ErrorRep } = REPS; -const { MODE } = require("../constants"); -const stubs = require("../stubs/error"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/error"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); describe("Error - Simple error", () => { diff --git a/devtools/client/shared/components/reps/reps/tests/event.js b/devtools/client/shared/components/reps/reps/tests/event.js index 8785dc389a53c..7709883e48f19 100644 --- a/devtools/client/shared/components/reps/reps/tests/event.js +++ b/devtools/client/shared/components/reps/reps/tests/event.js @@ -2,17 +2,24 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Event } = REPS; const { expectActorAttribute, getSelectableInInspectorGrips, -} = require("./test-helpers"); +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); -const { MODE } = require("../constants"); -const stubs = require("../stubs/event"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/event"); describe("Event - beforeprint", () => { const object = stubs.get("testEvent"); diff --git a/devtools/client/shared/components/reps/reps/tests/failure.js b/devtools/client/shared/components/reps/reps/tests/failure.js index 8a9ce053d2d4e..005a81217aa32 100644 --- a/devtools/client/shared/components/reps/reps/tests/failure.js +++ b/devtools/client/shared/components/reps/reps/tests/failure.js @@ -2,14 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global beforeAll, afterAll */ const { shallow } = require("enzyme"); -const { REPS } = require("../rep"); +const { REPS } = require("devtools/client/shared/components/reps/reps/rep"); const { Rep } = REPS; -const stubs = require("../stubs/failure"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/failure"); let originalConsoleError; beforeAll(() => { diff --git a/devtools/client/shared/components/reps/reps/tests/function.js b/devtools/client/shared/components/reps/reps/tests/function.js index 88b1659d9342b..8e3c3db6b9d7f 100644 --- a/devtools/client/shared/components/reps/reps/tests/function.js +++ b/devtools/client/shared/components/reps/reps/tests/function.js @@ -2,14 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { REPS } = require("../rep"); -const { MODE } = require("../constants"); +const { REPS } = require("devtools/client/shared/components/reps/reps/rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const { Func } = REPS; const { getFunctionName } = Func; -const stubs = require("../stubs/function"); -const { expectActorAttribute } = require("./test-helpers"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/function"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const renderRep = (object, props) => { return shallow(Func.rep({ object, ...props })); }; diff --git a/devtools/client/shared/components/reps/reps/tests/grip-array.js b/devtools/client/shared/components/reps/reps/tests/grip-array.js index 64b42bba1a0d2..2ce1e68f09129 100644 --- a/devtools/client/shared/components/reps/reps/tests/grip-array.js +++ b/devtools/client/shared/components/reps/reps/tests/grip-array.js @@ -2,17 +2,21 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { getRep } = require("../rep"); -const GripArray = require("../grip-array"); -const { MODE } = require("../constants"); -const stubs = require("../stubs/grip-array"); +const { getRep } = require("devtools/client/shared/components/reps/reps/rep"); +const GripArray = require("devtools/client/shared/components/reps/reps/grip-array"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); const { expectActorAttribute, getSelectableInInspectorGrips, getGripLengthBubbleText, -} = require("./test-helpers"); +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { maxLengthMap } = GripArray; function shallowRenderRep(object, props = {}) { diff --git a/devtools/client/shared/components/reps/reps/tests/grip-map-entry.js b/devtools/client/shared/components/reps/reps/tests/grip-map-entry.js index 0297b6439a332..48cdd4fa51e6a 100644 --- a/devtools/client/shared/components/reps/reps/tests/grip-map-entry.js +++ b/devtools/client/shared/components/reps/reps/tests/grip-map-entry.js @@ -2,19 +2,28 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { GripMapEntry } = REPS; const { createGripMapEntry } = GripMapEntry; -const { MODE } = require("../constants"); -const { getGripLengthBubbleText } = require("./test-helpers"); - -const stubs = require("../stubs/grip-map-entry"); -const nodeStubs = require("../stubs/element-node"); -const gripArrayStubs = require("../stubs/grip-array"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + getGripLengthBubbleText, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); + +const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map-entry"); +const nodeStubs = require("devtools/client/shared/components/reps/reps/stubs/element-node"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); const renderRep = (object, mode, props) => { return shallow( diff --git a/devtools/client/shared/components/reps/reps/tests/grip-map.js b/devtools/client/shared/components/reps/reps/tests/grip-map.js index 7e3aedadc49e9..f43b22b0a5745 100644 --- a/devtools/client/shared/components/reps/reps/tests/grip-map.js +++ b/devtools/client/shared/components/reps/reps/tests/grip-map.js @@ -2,18 +2,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { getRep } = require("../rep"); -const GripMap = require("../grip-map"); -const { MODE } = require("../constants"); -const stubs = require("../stubs/grip-map"); +const { getRep } = require("devtools/client/shared/components/reps/reps/rep"); +const GripMap = require("devtools/client/shared/components/reps/reps/grip-map"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); const { expectActorAttribute, getSelectableInInspectorGrips, getMapLengthBubbleText, -} = require("./test-helpers"); +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { maxLengthMap, getLength } = GripMap; function shallowRenderRep(object, props = {}) { diff --git a/devtools/client/shared/components/reps/reps/tests/grip.js b/devtools/client/shared/components/reps/reps/tests/grip.js index d2206447737e4..010edcda0495c 100644 --- a/devtools/client/shared/components/reps/reps/tests/grip.js +++ b/devtools/client/shared/components/reps/reps/tests/grip.js @@ -2,20 +2,27 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { getRep, Rep } = require("../rep"); -const Grip = require("../grip"); -const { MODE } = require("../constants"); -const stubs = require("../stubs/grip"); -const gripArrayStubs = require("../stubs/grip-array"); +const { + getRep, + Rep, +} = require("devtools/client/shared/components/reps/reps/rep"); +const Grip = require("devtools/client/shared/components/reps/reps/grip"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); +const gripArrayStubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); const { expectActorAttribute, getSelectableInInspectorGrips, getGripLengthBubbleText, -} = require("./test-helpers"); +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { maxLengthMap } = Grip; function shallowRenderRep(object, props = {}) { diff --git a/devtools/client/shared/components/reps/reps/tests/helper-tests.js b/devtools/client/shared/components/reps/reps/tests/helper-tests.js index b8df3c64ba3dd..0d66d6fb2c7eb 100644 --- a/devtools/client/shared/components/reps/reps/tests/helper-tests.js +++ b/devtools/client/shared/components/reps/reps/tests/helper-tests.js @@ -2,9 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { MODE } = require("../constants"); -const stubs = require("../stubs/grip-array"); -const { getGripLengthBubbleText } = require("./test-helpers"); +"use strict"; + +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); +const { + getGripLengthBubbleText, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); describe("getGripLengthBubbleText - Zero length", () => { const object = stubs.get("testBasic"); diff --git a/devtools/client/shared/components/reps/reps/tests/infinity.js b/devtools/client/shared/components/reps/reps/tests/infinity.js index 03dfeac9f95e3..0b59e49a0baef 100644 --- a/devtools/client/shared/components/reps/reps/tests/infinity.js +++ b/devtools/client/shared/components/reps/reps/tests/infinity.js @@ -2,13 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { InfinityRep, Rep } = REPS; -const stubs = require("../stubs/infinity"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/infinity"); describe("testInfinity", () => { const stub = stubs.get("Infinity"); diff --git a/devtools/client/shared/components/reps/reps/tests/long-string.js b/devtools/client/shared/components/reps/reps/tests/long-string.js index de99e96638db5..fc36b854b3690 100644 --- a/devtools/client/shared/components/reps/reps/tests/long-string.js +++ b/devtools/client/shared/components/reps/reps/tests/long-string.js @@ -2,15 +2,24 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { ELLIPSIS } = require("../rep-utils"); +const { + ELLIPSIS, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const { StringRep } = REPS; -const stubs = require("../stubs/long-string"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/long-string"); function quoteNewlines(text) { return text.split("\n").join("\\n"); diff --git a/devtools/client/shared/components/reps/reps/tests/nan.js b/devtools/client/shared/components/reps/reps/tests/nan.js index 936bfa9f3a395..ee0a73fb58037 100644 --- a/devtools/client/shared/components/reps/reps/tests/nan.js +++ b/devtools/client/shared/components/reps/reps/tests/nan.js @@ -2,13 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { NaNRep, Rep } = REPS; -const stubs = require("../stubs/nan"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/nan"); describe("NaN", () => { const stub = stubs.get("NaN"); diff --git a/devtools/client/shared/components/reps/reps/tests/null.js b/devtools/client/shared/components/reps/reps/tests/null.js index 6f74ad60f2766..9fa64a334326f 100644 --- a/devtools/client/shared/components/reps/reps/tests/null.js +++ b/devtools/client/shared/components/reps/reps/tests/null.js @@ -2,13 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Null, Rep } = REPS; -const stubs = require("../stubs/null"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/null"); describe("testNull", () => { const stub = stubs.get("Null"); diff --git a/devtools/client/shared/components/reps/reps/tests/number.js b/devtools/client/shared/components/reps/reps/tests/number.js index a7269866282dd..548a0e37a6f84 100644 --- a/devtools/client/shared/components/reps/reps/tests/number.js +++ b/devtools/client/shared/components/reps/reps/tests/number.js @@ -2,10 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Number, Rep } = REPS; -const stubs = require("../stubs/number"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/number"); describe("Int", () => { const stub = stubs.get("Int"); diff --git a/devtools/client/shared/components/reps/reps/tests/object-with-text.js b/devtools/client/shared/components/reps/reps/tests/object-with-text.js index 7083a4e2405ef..4fd00fbff0584 100644 --- a/devtools/client/shared/components/reps/reps/tests/object-with-text.js +++ b/devtools/client/shared/components/reps/reps/tests/object-with-text.js @@ -2,12 +2,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -const { REPS, getRep } = require("../rep"); +"use strict"; + +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { shallow } = require("enzyme"); -const { expectActorAttribute } = require("./test-helpers"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); -const stubs = require("../stubs/object-with-text"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/object-with-text"); const { ObjectWithText, Rep } = REPS; describe("Object with text - CSSStyleRule", () => { diff --git a/devtools/client/shared/components/reps/reps/tests/object-with-url.js b/devtools/client/shared/components/reps/reps/tests/object-with-url.js index d993e0a053f70..8f340c46b3798 100644 --- a/devtools/client/shared/components/reps/reps/tests/object-with-url.js +++ b/devtools/client/shared/components/reps/reps/tests/object-with-url.js @@ -2,11 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { ObjectWithURL } = REPS; -const stubs = require("../stubs/object-with-url"); -const { expectActorAttribute } = require("./test-helpers"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/object-with-url"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); describe("ObjectWithURL", () => { const stub = stubs.get("ObjectWithUrl"); diff --git a/devtools/client/shared/components/reps/reps/tests/object.js b/devtools/client/shared/components/reps/reps/tests/object.js index a8945b16b0825..faeb193cc6384 100644 --- a/devtools/client/shared/components/reps/reps/tests/object.js +++ b/devtools/client/shared/components/reps/reps/tests/object.js @@ -2,10 +2,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Obj } = REPS; -const { MODE } = require("../constants"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const renderComponent = (object, props) => { return shallow(Obj.rep({ object, ...props })); @@ -210,129 +217,129 @@ describe("Object - noGrip prop", () => { }); it("Attribute grip", () => { - const stubs = require("../stubs/attribute"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/attribute"); expect(getRep(stubs.get("Attribute"), undefined, true)).toBe(Obj.rep); }); it("CommentNode grip", () => { - const stubs = require("../stubs/comment-node"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/comment-node"); expect(getRep(stubs.get("Comment"), undefined, true)).toBe(Obj.rep); }); it("DateTime grip", () => { - const stubs = require("../stubs/date-time"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/date-time"); expect(getRep(stubs.get("DateTime"), undefined, true)).toBe(Obj.rep); }); it("Document grip", () => { - const stubs = require("../stubs/document"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/document"); expect(getRep(stubs.get("Document"), undefined, true)).toBe(Obj.rep); }); it("ElementNode grip", () => { - const stubs = require("../stubs/element-node"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/element-node"); expect(getRep(stubs.get("BodyNode"), undefined, true)).toBe(Obj.rep); }); it("Error grip", () => { - const stubs = require("../stubs/error"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/error"); expect(getRep(stubs.get("SimpleError"), undefined, true)).toBe(Obj.rep); }); it("Event grip", () => { - const stubs = require("../stubs/event"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/event"); expect(getRep(stubs.get("testEvent"), undefined, true)).toBe(Obj.rep); }); it("Function grip", () => { - const stubs = require("../stubs/function"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/function"); expect(getRep(stubs.get("Named"), undefined, true)).toBe(Obj.rep); }); it("Array grip", () => { - const stubs = require("../stubs/grip-array"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip-array"); expect(getRep(stubs.get("testMaxProps"), undefined, true)).toBe(Obj.rep); }); it("Map grip", () => { - const stubs = require("../stubs/grip-map"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip-map"); expect(getRep(stubs.get("testSymbolKeyedMap"), undefined, true)).toBe( Obj.rep ); }); it("Object grip", () => { - const stubs = require("../stubs/grip"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/grip"); expect(getRep(stubs.get("testMaxProps"), undefined, true)).toBe(Obj.rep); }); it("Infinity grip", () => { - const stubs = require("../stubs/infinity"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/infinity"); expect(getRep(stubs.get("Infinity"), undefined, true)).toBe(Obj.rep); }); it("LongString grip", () => { - const stubs = require("../stubs/long-string"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/long-string"); expect(getRep(stubs.get("testMultiline"), undefined, true)).toBe(Obj.rep); }); it("NaN grip", () => { - const stubs = require("../stubs/nan"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/nan"); expect(getRep(stubs.get("NaN"), undefined, true)).toBe(Obj.rep); }); it("Null grip", () => { - const stubs = require("../stubs/null"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/null"); expect(getRep(stubs.get("Null"), undefined, true)).toBe(Obj.rep); }); it("Number grip", () => { - const stubs = require("../stubs/number"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/number"); expect(getRep(stubs.get("NegZeroGrip"), undefined, true)).toBe(Obj.rep); }); it("ObjectWithText grip", () => { - const stubs = require("../stubs/object-with-text"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/object-with-text"); expect(getRep(stubs.get("ShadowRule"), undefined, true)).toBe(Obj.rep); }); it("ObjectWithURL grip", () => { - const stubs = require("../stubs/object-with-url"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/object-with-url"); expect(getRep(stubs.get("ObjectWithUrl"), undefined, true)).toBe(Obj.rep); }); it("Promise grip", () => { - const stubs = require("../stubs/promise"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/promise"); expect(getRep(stubs.get("Pending"), undefined, true)).toBe(Obj.rep); }); it("RegExp grip", () => { - const stubs = require("../stubs/regexp"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/regexp"); expect(getRep(stubs.get("RegExp"), undefined, true)).toBe(Obj.rep); }); it("Stylesheet grip", () => { - const stubs = require("../stubs/stylesheet"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/stylesheet"); expect(getRep(stubs.get("StyleSheet"), undefined, true)).toBe(Obj.rep); }); it("Symbol grip", () => { - const stubs = require("../stubs/symbol"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/symbol"); expect(getRep(stubs.get("Symbol"), undefined, true)).toBe(Obj.rep); }); it("TextNode grip", () => { - const stubs = require("../stubs/text-node"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/text-node"); expect(getRep(stubs.get("testRendering"), undefined, true)).toBe(Obj.rep); }); it("Undefined grip", () => { - const stubs = require("../stubs/undefined"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/undefined"); expect(getRep(stubs.get("Undefined"), undefined, true)).toBe(Obj.rep); }); it("Window grip", () => { - const stubs = require("../stubs/window"); + const stubs = require("devtools/client/shared/components/reps/reps/stubs/window"); expect(getRep(stubs.get("Window"), undefined, true)).toBe(Obj.rep); }); diff --git a/devtools/client/shared/components/reps/reps/tests/promise.js b/devtools/client/shared/components/reps/reps/tests/promise.js index 235f16201840f..bbfc949145e18 100644 --- a/devtools/client/shared/components/reps/reps/tests/promise.js +++ b/devtools/client/shared/components/reps/reps/tests/promise.js @@ -2,17 +2,24 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { PromiseRep } = REPS; -const { MODE } = require("../constants"); -const stubs = require("../stubs/promise"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/promise"); const { expectActorAttribute, getSelectableInInspectorGrips, getGripLengthBubbleText, -} = require("./test-helpers"); +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const renderRep = (object, props) => { return shallow(PromiseRep.rep({ object, ...props })); diff --git a/devtools/client/shared/components/reps/reps/tests/regexp.js b/devtools/client/shared/components/reps/reps/tests/regexp.js index b1320ef58cdb2..0b69095a8dcef 100644 --- a/devtools/client/shared/components/reps/reps/tests/regexp.js +++ b/devtools/client/shared/components/reps/reps/tests/regexp.js @@ -2,12 +2,21 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Rep, RegExp } = REPS; -const { ELLIPSIS } = require("../rep-utils"); -const stubs = require("../stubs/regexp"); -const { expectActorAttribute } = require("./test-helpers"); +const { + ELLIPSIS, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/regexp"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); describe("test RegExp", () => { const stub = stubs.get("RegExp"); diff --git a/devtools/client/shared/components/reps/reps/tests/string-with-url.js b/devtools/client/shared/components/reps/reps/tests/string-with-url.js index 96c63efe1c5b1..5a6c3c9f17856 100644 --- a/devtools/client/shared/components/reps/reps/tests/string-with-url.js +++ b/devtools/client/shared/components/reps/reps/tests/string-with-url.js @@ -2,11 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { mount } = require("enzyme"); -const { REPS } = require("../rep"); +const { REPS } = require("devtools/client/shared/components/reps/reps/rep"); const { Rep } = REPS; -const { getGripLengthBubbleText } = require("./test-helpers"); +const { + getGripLengthBubbleText, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); const renderRep = (string, props) => mount( @@ -540,7 +544,7 @@ describe("test String with URL", () => { }); it("does render a link in a grip array", () => { - const object = require("../stubs/grip-array").get( + const object = require("devtools/client/shared/components/reps/reps/stubs/grip-array").get( '["http://example.com/abcdefghijabcdefghij some other text"]' ); const length = getGripLengthBubbleText(object); @@ -574,7 +578,7 @@ describe("test String with URL", () => { }); it("does render a link in a grip object", () => { - const object = require("../stubs/grip").get( + const object = require("devtools/client/shared/components/reps/reps/stubs/grip").get( '{test: "http://example.com/ some other text"}' ); const openLink = jest.fn(); diff --git a/devtools/client/shared/components/reps/reps/tests/string.js b/devtools/client/shared/components/reps/reps/tests/string.js index 7c535a86c8d14..c8e63fb5d01be 100644 --- a/devtools/client/shared/components/reps/reps/tests/string.js +++ b/devtools/client/shared/components/reps/reps/tests/string.js @@ -2,9 +2,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow, mount } = require("enzyme"); -const { ELLIPSIS } = require("../rep-utils"); -const { REPS } = require("../rep"); +const { + ELLIPSIS, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { REPS } = require("devtools/client/shared/components/reps/reps/rep"); const { Rep } = REPS; const renderRep = (string, props) => diff --git a/devtools/client/shared/components/reps/reps/tests/stylesheet.js b/devtools/client/shared/components/reps/reps/tests/stylesheet.js index df30e87f13675..239065f7f8e30 100644 --- a/devtools/client/shared/components/reps/reps/tests/stylesheet.js +++ b/devtools/client/shared/components/reps/reps/tests/stylesheet.js @@ -2,11 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { StyleSheet, Rep } = REPS; -const stubs = require("../stubs/stylesheet"); -const { expectActorAttribute } = require("./test-helpers"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/stylesheet"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); describe("Test StyleSheet", () => { const stub = stubs.get("StyleSheet"); diff --git a/devtools/client/shared/components/reps/reps/tests/symbol.js b/devtools/client/shared/components/reps/reps/tests/symbol.js index a9075f2718aa2..1caa345082c3e 100644 --- a/devtools/client/shared/components/reps/reps/tests/symbol.js +++ b/devtools/client/shared/components/reps/reps/tests/symbol.js @@ -2,11 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS } = require("../rep"); +const { REPS } = require("devtools/client/shared/components/reps/reps/rep"); const { Rep } = REPS; -const stubs = require("../stubs/symbol"); -const { expectActorAttribute } = require("./test-helpers"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/symbol"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); describe("test Symbol", () => { const stub = stubs.get("Symbol"); diff --git a/devtools/client/shared/components/reps/reps/tests/test-helpers.js b/devtools/client/shared/components/reps/reps/tests/test-helpers.js index 1eeeaaf5b3e62..3083e24e3e614 100644 --- a/devtools/client/shared/components/reps/reps/tests/test-helpers.js +++ b/devtools/client/shared/components/reps/reps/tests/test-helpers.js @@ -2,19 +2,25 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { lengthBubble } = require("../../shared/grip-length-bubble"); +const { + lengthBubble, +} = require("devtools/client/shared/components/reps/shared/grip-length-bubble"); const { maxLengthMap: arrayLikeMaxLengthMap, getLength: getArrayLikeLength, -} = require("../grip-array"); +} = require("devtools/client/shared/components/reps/reps/grip-array"); const { maxLengthMap: mapMaxLengths, getLength: getMapLength, -} = require("../grip-map"); -const { getGripPreviewItems } = require("../rep-utils"); -const nodeConstants = require("../../shared/dom-node-constants"); +} = require("devtools/client/shared/components/reps/reps/grip-map"); +const { + getGripPreviewItems, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const nodeConstants = require("devtools/client/shared/components/reps/shared/dom-node-constants"); /** * Get an array of all the items from the grip in parameter (including the grip diff --git a/devtools/client/shared/components/reps/reps/tests/text-node.js b/devtools/client/shared/components/reps/reps/tests/text-node.js index 7f80972dd5acf..0da3acee8bb85 100644 --- a/devtools/client/shared/components/reps/reps/tests/text-node.js +++ b/devtools/client/shared/components/reps/reps/tests/text-node.js @@ -2,15 +2,24 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /* global jest */ const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); -const { MODE } = require("../constants"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const { TextNode } = REPS; -const stubs = require("../stubs/text-node"); -const { expectActorAttribute } = require("./test-helpers"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/text-node"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); describe("TextNode", () => { it("selects TextNode Rep as expected", () => { diff --git a/devtools/client/shared/components/reps/reps/tests/undefined.js b/devtools/client/shared/components/reps/reps/tests/undefined.js index 8f207adf7a3f6..f5a3daaebb211 100644 --- a/devtools/client/shared/components/reps/reps/tests/undefined.js +++ b/devtools/client/shared/components/reps/reps/tests/undefined.js @@ -2,13 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); const { Undefined, Rep } = REPS; -const stubs = require("../stubs/undefined"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/undefined"); // Test that correct rep is chosen describe("Test Undefined", () => { const stub = stubs.get("Undefined"); diff --git a/devtools/client/shared/components/reps/reps/tests/window.js b/devtools/client/shared/components/reps/reps/tests/window.js index aa8d5c446cccb..79124741572e2 100644 --- a/devtools/client/shared/components/reps/reps/tests/window.js +++ b/devtools/client/shared/components/reps/reps/tests/window.js @@ -2,14 +2,23 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const { shallow } = require("enzyme"); -const { REPS, getRep } = require("../rep"); +const { + REPS, + getRep, +} = require("devtools/client/shared/components/reps/reps/rep"); -const { MODE } = require("../constants"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); const { Rep, Window } = REPS; -const stubs = require("../stubs/window"); -const { expectActorAttribute } = require("./test-helpers"); +const stubs = require("devtools/client/shared/components/reps/reps/stubs/window"); +const { + expectActorAttribute, +} = require("devtools/client/shared/components/reps/reps/tests/test-helpers"); describe("test Window", () => { const stub = stubs.get("Window"); diff --git a/devtools/client/shared/components/reps/reps/text-node.js b/devtools/client/shared/components/reps/reps/text-node.js index d237810c93d17..c095a031279fa 100644 --- a/devtools/client/shared/components/reps/reps/text-node.js +++ b/devtools/client/shared/components/reps/reps/text-node.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const { button, @@ -10,8 +12,14 @@ const { const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); // Reps -const { isGrip, cropString, wrapRender } = require("./rep-utils"); -const { MODE } = require("./constants"); +const { + isGrip, + cropString, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); /** * Renders DOM #text node. diff --git a/devtools/client/shared/components/reps/reps/undefined.js b/devtools/client/shared/components/reps/reps/undefined.js index a681e55e1bfb0..60334f75db217 100644 --- a/devtools/client/shared/components/reps/reps/undefined.js +++ b/devtools/client/shared/components/reps/reps/undefined.js @@ -2,12 +2,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Dependencies const { span } = require("devtools/client/shared/vendor/react-dom-factories"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const { getGripType, wrapRender } = require("./rep-utils"); +const { + getGripType, + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); /** * Renders undefined value diff --git a/devtools/client/shared/components/reps/reps/window.js b/devtools/client/shared/components/reps/reps/window.js index 68f2113d70108..ba6b7f03e15bb 100644 --- a/devtools/client/shared/components/reps/reps/window.js +++ b/devtools/client/shared/components/reps/reps/window.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // ReactJS const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { span } = require("devtools/client/shared/vendor/react-dom-factories"); @@ -12,9 +14,11 @@ const { isGrip, getURLDisplayString, wrapRender, -} = require("./rep-utils"); +} = require("devtools/client/shared/components/reps/reps/rep-utils"); -const { MODE } = require("./constants"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); /** * Renders a grip representing a window. diff --git a/devtools/client/shared/components/reps/shared/dom-node-constants.js b/devtools/client/shared/components/reps/shared/dom-node-constants.js index 9037b9276b324..07850ee8d6cf1 100644 --- a/devtools/client/shared/components/reps/shared/dom-node-constants.js +++ b/devtools/client/shared/components/reps/shared/dom-node-constants.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + module.exports = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, diff --git a/devtools/client/shared/components/reps/shared/grip-length-bubble.js b/devtools/client/shared/components/reps/shared/grip-length-bubble.js index 316a8c2241500..27674495b1ca4 100644 --- a/devtools/client/shared/components/reps/shared/grip-length-bubble.js +++ b/devtools/client/shared/components/reps/shared/grip-length-bubble.js @@ -2,11 +2,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const { wrapRender } = require("../reps/rep-utils"); -const { MODE } = require("../reps/constants"); -const { ModePropType } = require("../reps/array"); +const { + wrapRender, +} = require("devtools/client/shared/components/reps/reps/rep-utils"); +const { + MODE, +} = require("devtools/client/shared/components/reps/reps/constants"); +const { + ModePropType, +} = require("devtools/client/shared/components/reps/reps/array"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); const { span } = dom; diff --git a/devtools/client/shared/components/reps/shared/redux/middleware/thunk.js b/devtools/client/shared/components/reps/shared/redux/middleware/thunk.js index dcdc9dbc5a854..8a0ba902718e7 100644 --- a/devtools/client/shared/components/reps/shared/redux/middleware/thunk.js +++ b/devtools/client/shared/components/reps/shared/redux/middleware/thunk.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + /** * A middleware that allows thunks (functions) to be dispatched. * If it's a thunk, it is called with `dispatch` and `getState`, diff --git a/devtools/client/shared/components/reps/shared/redux/middleware/waitUntilService.js b/devtools/client/shared/components/reps/shared/redux/middleware/waitUntilService.js index 59807ee3d8205..bdf7eb530905b 100644 --- a/devtools/client/shared/components/reps/shared/redux/middleware/waitUntilService.js +++ b/devtools/client/shared/components/reps/shared/redux/middleware/waitUntilService.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + const WAIT_UNTIL_TYPE = "@@service/waitUntil"; /** * A middleware which acts like a service, because it is stateful diff --git a/devtools/client/shared/components/reps/test/.eslintrc.js b/devtools/client/shared/components/reps/test/.eslintrc.js new file mode 100644 index 0000000000000..ffb3e70473bc8 --- /dev/null +++ b/devtools/client/shared/components/reps/test/.eslintrc.js @@ -0,0 +1,10 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + env: { + jest: true, + }, +}; diff --git a/devtools/client/shared/components/reps/test/__mocks__/selection.js b/devtools/client/shared/components/reps/test/__mocks__/selection.js index 7e2e8d4074d6d..66fd41b13363b 100644 --- a/devtools/client/shared/components/reps/test/__mocks__/selection.js +++ b/devtools/client/shared/components/reps/test/__mocks__/selection.js @@ -2,6 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + +/* global global*/ + let selection; const selectionObject = { toString: () => selection, diff --git a/devtools/client/shared/components/reps/test/setup-file.js b/devtools/client/shared/components/reps/test/setup-file.js index 6b5fc11f53c9b..d3aeace6a89cb 100644 --- a/devtools/client/shared/components/reps/test/setup-file.js +++ b/devtools/client/shared/components/reps/test/setup-file.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Configure enzyme-to-json serializer. const { createSerializer } = require("enzyme-to-json"); expect.addSnapshotSerializer(createSerializer({ mode: "deep" })); diff --git a/devtools/client/shared/components/reps/test/setup.js b/devtools/client/shared/components/reps/test/setup.js index a81ad0a93f4c5..861bde661f6de 100644 --- a/devtools/client/shared/components/reps/test/setup.js +++ b/devtools/client/shared/components/reps/test/setup.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ +"use strict"; + // Configure enzyme with React 16 adapter. const Enzyme = require("enzyme"); const Adapter = require("enzyme-adapter-react-16");