Skip to content

Fix non-deterministic test #389

Open
@ndowmon

Description

@ndowmon

I had the following test failure in CI recently. It looks like the to is a generated UUID which does not produce a deterministic test, since to could certainly have the substring 456.

FAIL packages/integration-sdk-cli/src/visualization/__tests__/createMappedRelationshipNodesAndEdges.test.ts
  ● #createMappedRelationshipNodesAndEdges › should return DUPLICATE KEY when duplicate non-matching entity found

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Array [
        Object {
          "dashes": true,
          "from": "123",
          "label": "HAS",
    -     "to": StringNotMatching /456/,
    +     "to": "8301fb58-b4ce-4562-bf99-6211a5aede38",
        },
      ]

      364 |     } = createMappedRelationshipNodesAndEdges({mappedRelationships, explicitEntities});
      365 | 
    > 366 |     expect(mappedRelationshipEdges).toEqual([
          |                                     ^
      367 |       {
      368 |         from: '123',
      369 |         to: expect.not.stringMatching('456'),

      at Object.<anonymous> (src/visualization/__tests__/createMappedRelationshipNodesAndEdges.test.ts:366:37)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions