Comments (7)
Hey peeps! I'm closing this ticket given that direct MDX support is not in our plans. You can achieve your tests by using --stories-json
or --index-json
(if you're using newer versions of test-runner). Thank you!
from test-runner.
@bodograumann is there a stories.json
file when you browse <your_sb_url>/stories.json
? that should be a valid workaround for MDX stories, so if it's not working I'd love to get to the bottom of it.
from test-runner.
Indeed, @shilman, I have enabled the buildStoriesJson
feature flag to get the stories.json
(not storyStoreV7 though).
There was a change in the output, but still no tests were found apparently.
Without --stories-json
:
> npm run storybook:test
> [email protected] storybook:test
> test-storybook
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In /home/bodo/my-app
323 files checked.
testMatch: **/*.stories.[jt]s?(x) - 0 matches
testPathIgnorePatterns: /node_modules/ - 323 matches
testRegex: - 0 matches
Pattern: - 0 matches
With --stories-json
:
> npm run storybook:test
> [email protected] storybook:test
> test-storybook -- --stories-json
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In /home/bodo/my-app
401 files checked.
testMatch: **/__tests__/**/*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x) - 8 matches
testPathIgnorePatterns: /node_modules/ - 401 matches
testRegex: - 0 matches
Pattern: --stories-json|--config|/home/bodo/my-app/node_modules/@storybook/test-runner/test-runner-jest.config.js - 0 matches
from test-runner.
Hey @bodograumann is there a chance you're using v0.0.1? If so, can you try v0.0.2-next.4 and run the same command?
from test-runner.
BTW thank you a lot for trying this library! It's incredible how active you are around the storybook community and we really appreciate that!!
from test-runner.
Thank you for saying that, @yannbf
You were right with your guess. I had, kind of blindly, followed the installation instructions and of course gotten only version 0.0.1.
With 0.0.2-next.4 and using --stories-json
the tests are all run β€οΈ.
I am leaving this ticket open for first-level mdx support, but for now this is already a good solution for us. π
from test-runner.
Are there any updates on this? I'm trying to test (local) stories from MDX files (accessibility & interactions)
The tests run within storybook fine, but don't run using test runner
I'm currently on v0.1.1
When I enable the buildStoriesJson
flag in storybook/main.js
it this throws an error when running storybook - without it I always get the above no stories found error
.../node_modules/file-system-cache/lib/common/Util.js:66
throw new Error(`Failed to read cache value at: ${path}. ${error.message}`);
EDIT: I found a solution
In my case, this was because the storybook build was erroring.
Once I followed the instructions in this issue, it was fixed
from test-runner.
Related Issues (20)
- [bug] coverage no longer report in terminal HOT 2
- [bug] Add support for passWithNoTests
- [question] Error: Cannot find module 'detect-package-manager' HOT 1
- [bug] test-runner doesn't execute in the project folder HOT 2
- CLI tests don't run using chromium browser with error message "invalid version" HOT 1
- [bug] --failOnConsole not working with Mock Service Worker
- [bug] Issue with open HTTP connections: Jest did not exit
- Skip or Exclude not working on play-tests HOT 2
- How to specify Chromium path HOT 3
- Installation Error with NPM HOT 2
- [question] Any plans to move or support vitest?
- [bug] Doesn't work with git worktrees HOT 1
- [Bug]: Type of canvasElement from getStoryContext is unknown HOT 2
- [question] Any plans to support v8.0.0???? HOT 1
- Test runner rendering next story before previous tests finish
- [bug] `getStoryContext` is missing `playFunction` HOT 1
- [bug] preVisit accesses the story store before the index is ready HOT 8
- [bug] the --outputFile parameter is not working when --junit parameter is issued HOT 4
- [bug] Storybook Test Runner Timeout with waitForPageReady HOT 2
- [feature request] Make tags available in the test context HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test-runner.