Raathigesh / majestic

⚡ Zero config GUI for Jest
MIT License
7.49k stars 173 forks source link

GraphQL error preventing tests being shown #222

Open IPWright83 opened 2 years ago

IPWright83 commented 2 years ago

Is this a bug report or a feature request?

Bug

Version Info

Reproduction Repo

I can't really provide a quick reproduction, but I am happy to dig and find more information to diagnose. Essentially I get no tests shown in the file window for 1 particular file. I've not encountered this issue with any other files:

image

When selecting the file I encounter the following error in the console:

Uncaught (in promise) Error: GraphQL error: Unexpected token (7:12)
    at new t (ui.bundle.js:21)
    at e.<anonymous> (ui.bundle.js:21)
    at ui.bundle.js:16
    at Object.next (ui.bundle.js:16)
    at ui.bundle.js:16
    at new Promise (<anonymous>)
    at l (ui.bundle.js:16)
    at ui.bundle.js:21
    at ui.bundle.js:21
    at Array.forEach (<anonymous>)
t @ ui.bundle.js:21
(anonymous) @ ui.bundle.js:21
(anonymous) @ ui.bundle.js:16
(anonymous) @ ui.bundle.js:16
(anonymous) @ ui.bundle.js:16
l @ ui.bundle.js:16
(anonymous) @ ui.bundle.js:21
(anonymous) @ ui.bundle.js:21
(anonymous) @ ui.bundle.js:21
e.broadcastQueries @ ui.bundle.js:21
(anonymous) @ ui.bundle.js:21
(anonymous) @ ui.bundle.js:16
(anonymous) @ ui.bundle.js:16
(anonymous) @ ui.bundle.js:16
l @ ui.bundle.js:16
next @ ui.bundle.js:21
g @ ui.bundle.js:51
b @ ui.bundle.js:51
value @ ui.bundle.js:51
(anonymous) @ ui.bundle.js:21
next @ ui.bundle.js:21
g @ ui.bundle.js:51
b @ ui.bundle.js:51
value @ ui.bundle.js:51
(anonymous) @ ui.bundle.js:92
Promise.then (async)
(anonymous) @ ui.bundle.js:21
ha @ ui.bundle.js:42
(anonymous) @ ui.bundle.js:42
c @ ui.bundle.js:51
d @ ui.bundle.js:51
B.port1.onmessage @ ui.bundle.js:51

The pre-ceding request if it's helpful is this. I've looked for odd characters in the describe/it names but can't see anything out of sorts.

{result: {…}}
  result:
    consoleLogs: null
    failureMessage: null
    numFailingTests: 0
    numPassingTests: 5
    path: "/home/ian/src/webclient/app/src/views/solutions/components/PaginatedTable/PaginatedTable.test.tsx"
    testResults: Array(5)
      0: {title: 'with no data', numPassingAsserts: 0, status: 'passed', failureMessages: Array(0), ancestorTitles: Array(2), …}
      1: {title: 'with data', numPassingAsserts: 0, status: 'passed', failureMessages: Array(0), ancestorTitles: Array(2), …}
      2: {title: 'with a custom header cell', numPassingAsserts: 0, status: 'passed', failureMessages: Array(0), ancestorTitles: Array(2), …}
      3: {title: 'with a custom data cell', numPassingAsserts: 0, status: 'passed', failureMessages: Array(0), ancestorTitles: Array(2), …}
      4: {title: 'with more than 8 rows', numPassingAsserts: 0, status: 'passed', failureMessages: Array(0), ancestorTitles: Array(2), …}
      length: 5
      [[Prototype]]: Array(0)
      __typename: "TestFileResult"
    [[Prototype]]: Object
  [[Prototype]]: Object
davidlav commented 2 years ago

Yep, some problem here in Firefox (pictured), Chrome, and Edge.

Version of Majestic: 1.8.1
Version of Jest: 27.5.1
Version of Node: 16.3.0
Operating System: Windows 10

image

ojaoc commented 2 years ago

I submited a PR to solve a similar issue, turns out the parser was breaking on numeric separators, but might still be happening in other situations. Nonetheless, PR #224