Comments (10)
I’ll do you one better, add a reference file when there isn’t one when running loki test
.
from loki.
Nice! Sounds good, how would that work with the requireReference flag? I guess it'd have to be either or? I could see use cases where you;d prefer options to do it either way
from loki.
On CI or with requireReference
it would not update
from loki.
Yeah that's what I was thinking 👍
from loki.
from loki.
@oblador Just had a play with it and it all seems to work fine. I just had a few thoughts:
- I think the docs should be updated to reflect the new behaviour.
- There's still the chance for someone to accidentally introduce regression by using update.
- The commands I now use for Loki are kinda unclear in terms of the process of how I use it. If I need to add a new reference image I can run a test or update, but update will also modify existing references, update can also be used to approve changes to files as can the approve command. In my head it makes sense to have commands responsible for a single thing e.g. this is the command you use to add reference images, this is the command you use to test and this is the command you use to approve changes.
from loki.
@geraintf There's loki approve
to just approve, is that what you're looking for?
from loki.
@oblador I think your change helps (and removes a potential step from the users workflow). I still think there is a way that a user could unknowingly introduce regression.
- User adds a new story/component
- User makes a change to some global styles (which breaks another component)
- User does
loki update
to add the new file (they could just doloki test
but not necessarily) - Loki adds the new reference images and approves broken tests.
This leads to potential regression going into production.
from loki.
IDK, this issue applies to jest snapshots too? Also you’d see these files both when committing and making a PR.
What is your proposed alternative workflow?
from loki.
Yeah, it's one of the downsides of jest, it relies on developers always looking through every failed snapshot (which might not always happen) but I guess the idea should be to make this as difficult as possible to happen.
I guess I imagine it being something like:
- Use
update
to add your initial ref images - Make some changes and/or add new story
- Run
test
- Test fails because a) You have a story without a reference image b) A story with a reference image is different
- You run
update
- this adds any missing reference images (buttest
would still fail because of the differences) - You then check that changes in reference images are what you expect, if so you
approve
At the moment that line between adding images and approving images is blurred with update also doing the job of approve.
from loki.
Related Issues (20)
- Failed to load stories in chrome.docker, loki version 0.32.0 HOT 5
- chrome.docker: Fetching stories stuck
- Unable to resolve "hoist-non-react-statics" on RN
- Docker container doesn't stop
- Loki is not supporting node 14 but lambda only runs on node 14. HOT 4
- @loki/target-chrome-app has an undeclared dependency on @loki/core [0.33.0]
- A new command line argument so you can provide the path to the loki config file
- Update wait-on to the latest version to fix CVE-2023-45857 vulnerability
- Command failed with exit code 125 HOT 3
- example-react "Animation" tests fails
- Random false positives when testing stories for components that have not been modified
- Storybook 8 compatibility HOT 6
- chrome.docker differences when running in CI compared to on MacOS HOT 2
- React Native Example
- Support createAsyncCallback in play function HOT 10
- React is not defined (Continuous Integration) HOT 1
- Error with yarn pnp
- Loki test ci on Bitbucket pipeline
- How to select html dialog element HOT 2
- TypeError: Failed to fetch dynamically imported module
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 loki.