Bug 1551218 - Part 4: Manually reformat the debugger where autofix wasn't possible, r=jlast
authorVictor Porof <vporof@mozilla.com>
Fri, 17 May 2019 15:51:55 +0000
changeset 536244 43baeaf538692336539ed241b32f25a9a8f1b69a
parent 536243 88358b362c57617c0c18926a8ead7337efe9c86a
child 536245 c81a6ac1b8941c4e2d3e596e9f172f8d255ac721
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1551218
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551218 - Part 4: Manually reformat the debugger where autofix wasn't possible, r=jlast Differential Revision: https://phabricator.services.mozilla.com/D30929
devtools/client/debugger/packages/devtools-source-map/src/tests/locations.js
devtools/client/debugger/packages/devtools-source-map/src/tests/source-map.js
devtools/client/debugger/packages/devtools-utils/src/tests/network-request.js
devtools/client/debugger/packages/devtools-utils/src/tests/worker-utils.js
--- a/devtools/client/debugger/packages/devtools-source-map/src/tests/locations.js
+++ b/devtools/client/debugger/packages/devtools-source-map/src/tests/locations.js
@@ -6,17 +6,17 @@ jest.mock("devtools-utils/src/network-re
 const {
   getOriginalLocation,
   getGeneratedLocation,
   clearSourceMaps,
 } = require("../source-map");
 
 const { setupBundleFixture } = require("./helpers");
 
-describe("getOriginalLocation", async () => {
+describe("getOriginalLocation", () => {
   beforeEach(() => {
     clearSourceMaps();
   });
 
   test("maps a generated location", async () => {
     await setupBundleFixture("bundle");
     const location = {
       sourceId: "bundle.js",
@@ -39,17 +39,17 @@ describe("getOriginalLocation", async ()
       sourceId: "bundle.js/originalSource-fe2c41d3535b76c158e39ba4f3ff826a",
       sourceUrl: "webpack:///entry.js",
     };
     const originalLocation = await getOriginalLocation(location);
     expect(originalLocation).toEqual(originalLocation);
   });
 });
 
-describe("getGeneratedLocation", async () => {
+describe("getGeneratedLocation", () => {
   beforeEach(() => {
     clearSourceMaps();
   });
 
   test("maps an original location", async () => {
     await setupBundleFixture("bundle");
     const location = {
       column: 0,
--- a/devtools/client/debugger/packages/devtools-source-map/src/tests/source-map.js
+++ b/devtools/client/debugger/packages/devtools-source-map/src/tests/source-map.js
@@ -134,17 +134,17 @@ describe("source maps", () => {
             line: 28,
             column: Infinity,
           },
         },
       ]);
     });
   });
 
-  describe("hasMappedSource", async () => {
+  describe("hasMappedSource", () => {
     test("has original location", async () => {
       await setupBundleFixture("bundle");
       const location = {
         sourceId: "bundle.js",
         line: 49,
       };
       const isMapped = await hasMappedSource(location);
       expect(isMapped).toBe(true);
@@ -155,17 +155,17 @@ describe("source maps", () => {
         sourceId: "bundle.js",
         line: 94,
       };
       const isMapped = await hasMappedSource(location);
       expect(isMapped).toBe(false);
     });
   });
 
-  describe("Error handling", async () => {
+  describe("Error handling", () => {
     test("missing map", async () => {
       const source = {
         id: "missingmap.js",
         sourceMapURL: "missingmap.js.map",
         url: "http:://example.com/missingmap.js",
       };
 
       networkRequest.mockImplementationOnce(() => {
--- a/devtools/client/debugger/packages/devtools-utils/src/tests/network-request.js
+++ b/devtools/client/debugger/packages/devtools-utils/src/tests/network-request.js
@@ -42,15 +42,17 @@ describe("network request", () => {
     } catch (e) {
       expect(e.message).toEqual("failed to request foo");
     }
   });
 
   it("timed out fetch", async () => {
     global.fetch.mockImplementation(async () => {});
 
-    networkRequest("foo").catch(e =>
-      expect(e.message).toEqual("Connect timeout error")
-    );
+    try {
+      await networkRequest("foo");
+    } catch (e) {
+      expect(e.message).toEqual("Connect timeout error");
+    }
 
     jest.runAllTimers();
   });
 });
--- a/devtools/client/debugger/packages/devtools-utils/src/tests/worker-utils.js
+++ b/devtools/client/debugger/packages/devtools-utils/src/tests/worker-utils.js
@@ -115,32 +115,36 @@ describe("worker utils", () => {
       results: [
         {
           error: "Error: failed",
         },
       ],
     });
   });
 
-  it("test a task completing when the worker has shutdown", () => {
+  it("test a task completing when the worker has shutdown", async () => {
     const dispatcher = new WorkerDispatcher();
     const postMessageMock = jest.fn();
     const addEventListenerMock = jest.fn();
     const terminateMock = jest.fn();
 
     global.Worker = jest.fn(() => {
       return {
         postMessage: postMessageMock,
         addEventListener: addEventListenerMock,
         terminate: terminateMock,
       };
     });
 
     dispatcher.start();
     const task = dispatcher.task("foo");
-    const resp = task("bar");
-    resp.catch(e => expect(e).toEqual("Oops, The worker has shutdown!"));
+
+    try {
+      await task("bar");
+    } catch (e) {
+      expect(e).toEqual("Oops, The worker has shutdown!");
+    }
 
     const listener = addEventListenerMock.mock.calls[0][1];
     dispatcher.stop();
     listener({ data: { id: 1 } });
   });
 });