question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(tests): docgen.parse

See original GitHub issue

Description

i have 2 tests failing.

Steps to reproduce

yarn test

note: since i get errors when installing with yarn.lock i delete it always before yarn run bootstrap

Expected result

no error

Actual result

Summary of all failing tests
 FAIL  packages/gatsby-transformer-react-docgen/src/__tests__/displayname-handler.js
  ● DisplayNameHandler › Explicitly set displayName as static class member

    No suitable component definition found.

      14 |     ${source}
      15 |   `
    > 16 |   return docgen.parse(code, findAllComponentDefinitions, [handler])[0]
         |                 ^
      17 | }
      18 | 
      19 | describe(`DisplayNameHandler`, () => {

      at parse (node_modules/react-docgen/dist/parse.js:66:13)
      at Object.parse (node_modules/react-docgen/dist/main.js:61:29)
      at parse (packages/gatsby-transformer-react-docgen/src/__tests__/displayname-handler.js:16:17)
      at Object.<anonymous> (packages/gatsby-transformer-react-docgen/src/__tests__/displayname-handler.js:32:17)

  ● DisplayNameHandler › Infer displayName from class declaration/expression name

    No suitable component definition found.

      14 |     ${source}
      15 |   `
    > 16 |   return docgen.parse(code, findAllComponentDefinitions, [handler])[0]
         |                 ^
      17 | }
      18 | 
      19 | describe(`DisplayNameHandler`, () => {

      at parse (node_modules/react-docgen/dist/parse.js:66:13)
      at Object.parse (node_modules/react-docgen/dist/main.js:61:29)
      at parse (packages/gatsby-transformer-react-docgen/src/__tests__/displayname-handler.js:16:17)
      at Object.<anonymous> (packages/gatsby-transformer-react-docgen/src/__tests__/displayname-handler.js:67:19)

Environment

Run gatsby info --clipboard in your project directory and paste the output here:


  System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
    Yarn: 1.21.0 - /usr/local/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v12.13.1/bin/npm
  Languages:
    Python: 3.7.6 - /usr/local/opt/python/libexec/bin/python
  Browsers:
    Chrome: 83.0.4103.61
    Safari: 13.0.5
  npmGlobalPackages:
    gatsby-cli: 2.12.29

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mueschacommented, Jun 4, 2020

@vladar

i created an PR:

  • #24788 fix(plugin): update react-docgen, fix tests
0reactions
vladarcommented, Jun 5, 2020

Fixed via #24788

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bugs and bugs around react-docgen · Issue #240 · doczjs/docz
I'm trying to use it with typescript, which is working fine except PropsTable which renders empty. I had similar issue when working with ......
Read more >
react-docgen-typescript-dumi-tmp - npm package - Snyk
A simple parser for React properties defined in TypeScript instead of propTypes. It can be used with React Styleguidist. Installation. npm ...
Read more >
styleguidist/styleguidist - Gitter
I have a question about testing. I just ran a test on my Styleguidist clone repo and it failed. I tested before any...
Read more >
Automating React Documentation using React ... - Ryosuke
I tested out two ways to use react-docgen to document React code. ... that grabs all the components and uses react-docgen API to...
Read more >
Conflict between gi-docgen and g-ir-doc-tool (#7685) - GitLab
Procedure.add_menu_path.page:34: parser error : Opening and ending tag mismatch: Image line 34 and p syntax `<Prefix>/Path/To/Submenu`, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found