diff --git a/packages/hermes-inspector-msggen/__tests__/CommandTest.js b/packages/hermes-inspector-msggen/__tests__/command-test.js similarity index 100% rename from packages/hermes-inspector-msggen/__tests__/CommandTest.js rename to packages/hermes-inspector-msggen/__tests__/command-test.js diff --git a/packages/hermes-inspector-msggen/__tests__/EventTest.js b/packages/hermes-inspector-msggen/__tests__/event-test.js similarity index 100% rename from packages/hermes-inspector-msggen/__tests__/EventTest.js rename to packages/hermes-inspector-msggen/__tests__/event-test.js diff --git a/packages/hermes-inspector-msggen/__tests__/GraphTest.js b/packages/hermes-inspector-msggen/__tests__/graph-test.js similarity index 84% rename from packages/hermes-inspector-msggen/__tests__/GraphTest.js rename to packages/hermes-inspector-msggen/__tests__/graph-test.js index b890c050ea8905..5d4043b80e0017 100644 --- a/packages/hermes-inspector-msggen/__tests__/GraphTest.js +++ b/packages/hermes-inspector-msggen/__tests__/graph-test.js @@ -25,8 +25,8 @@ beforeEach(() => { // checks id1 occurs after id2 in arr function expectOccursAfter(arr, id1, id2) { - let idx1 = arr.indexOf(id1); - let idx2 = arr.indexOf(id2); + const idx1 = arr.indexOf(id1); + const idx2 = arr.indexOf(id2); expect(idx1).not.toBe(-1); expect(idx2).not.toBe(-1); @@ -35,7 +35,9 @@ function expectOccursAfter(arr, id1, id2) { test('detects cycle', () => { graph.addEdge('C2', 'A1'); - expect(() => graph.traverse(['A2'])).toThrow(/^Not a DAG/); + + const {cycles} = graph.traverse(['A2']); + expect(cycles).toContainEqual({from: 'A1', to: 'B1'}); }); test('checks for presence of root', () => { @@ -43,10 +45,10 @@ test('checks for presence of root', () => { }); test('traverses partial graph', () => { - let ids = graph.traverse(['B1', 'A3']); + const {nodes: ids} = graph.traverse(['B1', 'A3']); // Check that expected nodes are there - let sortedIds = ids.slice().sort(); + const sortedIds = ids.slice().sort(); expect(sortedIds).toEqual(['A3', 'B1', 'B2', 'C1', 'C2', 'C3']); // Check that the result is topologically sorted @@ -59,10 +61,10 @@ test('traverses partial graph', () => { }); test('traverses complete graph', () => { - let ids = graph.traverse(['A1', 'A2', 'A3']); + const {nodes: ids} = graph.traverse(['A1', 'A2', 'A3']); // Check that expected nodes are there - let sortedIds = ids.slice().sort(); + const sortedIds = ids.slice().sort(); expect(sortedIds).toEqual(['A1', 'A2', 'A3', 'B1', 'B2', 'C1', 'C2', 'C3']); // Check that the result is topologically sorted diff --git a/packages/hermes-inspector-msggen/__tests__/HeaderWriterTest.js b/packages/hermes-inspector-msggen/__tests__/header-writer-test.js similarity index 95% rename from packages/hermes-inspector-msggen/__tests__/HeaderWriterTest.js rename to packages/hermes-inspector-msggen/__tests__/header-writer-test.js index da8bf0c03a6b50..5ba2bb2a1158b5 100644 --- a/packages/hermes-inspector-msggen/__tests__/HeaderWriterTest.js +++ b/packages/hermes-inspector-msggen/__tests__/header-writer-test.js @@ -40,8 +40,12 @@ test('emits type decl', () => { expectCodeIsEqual(stream.get(), ` struct debugger::Location : public Serializable { Location() = default; + Location(Location&&) = default; + Location(const Location&) = delete; explicit Location(const folly::dynamic &obj); folly::dynamic toDynamic() const override; + Location& operator=(const Location&) = delete; + Location& operator=(Location&&) = default; runtime::ScriptId scriptId{}; int lineNumber{}; diff --git a/packages/hermes-inspector-msggen/__tests__/ImplementationWriterTest.js b/packages/hermes-inspector-msggen/__tests__/implementation-writer-test.js similarity index 100% rename from packages/hermes-inspector-msggen/__tests__/ImplementationWriterTest.js rename to packages/hermes-inspector-msggen/__tests__/implementation-writer-test.js diff --git a/packages/hermes-inspector-msggen/__tests__/PropertyTest.js b/packages/hermes-inspector-msggen/__tests__/property-test.js similarity index 100% rename from packages/hermes-inspector-msggen/__tests__/PropertyTest.js rename to packages/hermes-inspector-msggen/__tests__/property-test.js diff --git a/packages/hermes-inspector-msggen/__tests__/TypeTest.js b/packages/hermes-inspector-msggen/__tests__/type-test.js similarity index 100% rename from packages/hermes-inspector-msggen/__tests__/TypeTest.js rename to packages/hermes-inspector-msggen/__tests__/type-test.js