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.

Failing to load config when doing unit tests with Jest (default config)

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

Storybooks fails fails to load/find .storybooks.

To Reproduce Steps to reproduce the behavior:

Create new project with vue-cli.

Use vue-cli plugin to add storybook to a fresh Vue project.

Follow instructions in the ‘Getting Started’ guide on setting up ‘Snapshot Testing’ (with Storyshots plugin).

Run:

npm run test:unit

Get:

ENOENT: no such file or directory, lstat '/path/to/project/.storybook'

Expected behavior A clear and concise description of what you expected to happen.

Tests to run.

Screenshots If applicable, add screenshots to help explain your problem.

N/A.

Code snippets If applicable, add code samples to help explain your problem.

N/A.

System:

  • OS: Ubuntu 18.10
  • Device: Desktop
  • Browser: Chrome
  • Framework: Vue
  • Addons: N/A.
  • Version:
    "@storybook/addon-actions": "^4.1.0",
    "@storybook/addon-knobs": "^4.1.0",
    "@storybook/addon-links": "^4.1.0",
    "@storybook/addon-notes": "^4.1.0",
    "@storybook/addon-storyshots": "^4.1.11",
    "vue-cli-plugin-storybook": "^0.5.1",

Additional context Add any other context about the problem here.

N/A.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tmeasdaycommented, Mar 18, 2019

Hi @CrashyBang – sorry I didn’t see your messages above (?)

I think your issue here is you have put your storybook config in a non-standard location (config/storybook). Try passing { configPath: './config/storybook' } to the initStoryshots function.

0reactions
chopfitzroycommented, Mar 18, 2019

Hey @tmeasday,

Yep that sorted it, I had to use { configPath: './testing/config/storybook' } but now everything works accordingly.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Jest
You can retrieve Jest's defaults from jest-config to extend them if needed: ... __tests__/**", "**/*.js"] will not exclude __tests__ because the negation is ......
Read more >
Reading in config data throws error in jest unit test
I'm using react in conjunction Jest and enzyme. My unit tests were working as desired until I added a config.json that lives in ......
Read more >
Setup - Testing Library
If you're using the Jest testing framework version 24 or lower with the default configuration, it's recommended to use jest-environment-jsdom- ...
Read more >
Configuring Jest
By default, Jest runs all tests and produces all errors into the console upon completion. The bail config option can be used here...
Read more >
Run/Debug Configuration: Jest | IntelliJ IDEA Documentation
Create: Run | Edit Configurations | Add New Configuration | Jest. In this dialog, create configurations for running Jest tests.
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