summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/utils/tests/project-search.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/src/utils/tests/project-search.spec.js')
-rw-r--r--devtools/client/debugger/src/utils/tests/project-search.spec.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/devtools/client/debugger/src/utils/tests/project-search.spec.js b/devtools/client/debugger/src/utils/tests/project-search.spec.js
new file mode 100644
index 0000000000..6dbf910274
--- /dev/null
+++ b/devtools/client/debugger/src/utils/tests/project-search.spec.js
@@ -0,0 +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 <http://mozilla.org/MPL/2.0/>. */
+
+import { highlightMatches } from "../project-search";
+
+describe("project search - highlightMatches", () => {
+ it("simple", () => {
+ const lineMatch = {
+ type: "MATCH",
+ value: "This is a sample sentence",
+ line: 1,
+ column: 17,
+ matchIndex: 17,
+ match: "sentence",
+ sourceId: "source",
+ text: "text",
+ };
+
+ expect(highlightMatches(lineMatch)).toMatchSnapshot();
+ });
+});