Comments (6)
If you want to keep it in cli it can be something like
SNAPSHOTS_CREATION=false phpunit
for avoiding snapshot creation (orWITHOUT_CREATING_SNAPSHOT=true
if you prefer)SNAPSHOTS_UPDATE=true phpunit
to allow snapshot update if already existing.
But with that, we also can set it in .env, in CI env var, in phpunit.xml file, etc. so the users can do whatever they want.
from phpunit-snapshot-assertions.
I did something mildly related in our project:
I learned that when you're developing locally, you really always just want to update the snapshots. You'll see the diff anyway in your favorite VCS. But with a lots-of-devs it's easy to have someone not add this setting into their favourite IDE integration etc. So I extended the trait from this package and implemented my own shouldUpdateSnapshots
with some env checking.
And in fact, if the env vars would have been supported already, I could have added this to the shared phpunit.xm.dist
for example, not needing to change anything with the package.
I like the idea and too think that env vars are more flexible; the package could just keep the existing behaviour (e.g. command line overrides env var?) and add the new ones.
from phpunit-snapshot-assertions.
I like that users of our package can now simply add something to the command to change certain behaviour. What would the required steps be for a user to run that tests without creating snapshots?
from phpunit-snapshot-assertions.
I would be open for a PR that allows listening for env vars and while still keeping support for the current command line parameters.
from phpunit-snapshot-assertions.
Ok I'm doing it.
Do you have a preference for the env var names ?
CREATE_SNAPSHOTS=false
and UPDATE_SNAPSHOTS=true
are ok for you?
from phpunit-snapshot-assertions.
We'll continue the conversation in #126
from phpunit-snapshot-assertions.
Related Issues (20)
- Tag release with PHP 8.0 support HOT 1
- Return snapshot object from assertion HOT 3
- JSON encode unescape unicode in snapshot file HOT 2
- MongoDB ObjectId spanshots are wrong HOT 1
- snapshotConstraint proposal
- Is it possible to allow certain differences in snapshots? HOT 3
- Incorrect HTML output HOT 10
- Failing on Windows because of new line
- need a way to update snapshots with codecept HOT 1
- Assertions broken for tests with dataprovider HOT 2
- FileSnapShot no longer includes the name of the data provider
- Tests are not correctly marked as incomplete when creating/updating snapshots HOT 3
- Support inline snapshots HOT 3
- JSON driver fails to assert difference between empty object and array
- Feature Request: Support for Tabular-Assertions as a snapshot format HOT 3
- Updating to PHPUnit 11.x outputs deprecation notices HOT 1
- Allow passing variables to Snapshot to enable dynamic responses
- Allow symfony 7 in v4
- Make it usable with docker container HOT 1
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 phpunit-snapshot-assertions.