Comments (6)
HTH. I'm enjoying the library: great output, and the snapshot functions are really useful. Thanks!
from testza.
Hi @jamestelfer, I cannot reproduce it with my machine. But you're totally right, that the permission should be changed to be equal to the others. I will, most likely, push a release today, that includes this fix. It would be kind if you could report if it works then!
And thanks for the compliment! 😄
from testza.
No worries and thanks! I will definitely check it out.
I can only reproduce it when the snapshots are first created and there's no existing directory. I'm not sure either whether it's impacted by my use of t.Run()
and t.Name()
with a data driven test, which increases the levels of directory nesting.
I looked at creating a test case and a PR but I wasn't sure how to try to get the snapshots to be sourced from a separate folder. I can't say that I looked deeply at it though (sorry).
This was occurring for me on a Mac, haven't tried any other systems.
from testza.
OK I have a minimal repro:
func TestSnapshots(t *testing.T) {
cases := []struct {
name string
}{
{
name: "nested-name",
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
// this should fail as the snapshot file can't be written to the directory that doesn't exist
err := testza.SnapshotCreateOrValidate(t, t.Name(), "flamingos are pink")
testza.AssertNoError(t, err)
})
}
}
Let me see if I can get a failing test case out of this.
from testza.
That should do the trick, but feel free to change the test in whatever way you see fit. I had a linter issue that I've come across at work a few times, so hopefully #109 will fix that too.
Thanks for the project!
from testza.
Hi @jamestelfer, thanks for the PR! I am currently looking into it, and it looks good.
from testza.
Related Issues (20)
- Improve output of `AssertNotSameElements`
- Color object of `AssertNotZero`
- Color object of `AssertNumeric`
- Recolor object of `AssertRegexp`
- Color objects of `AssertSubset` HOT 1
- Color object name of `AssertZero` magenta
- Make settings configurable with environment variables
- Refactor to 1.18 generics
- Make functions in `assertion_helper.go` to `testing.Helper` functions
- Show which test failed in `AssertTestFails`
- Add `FuzzUtilMergeSets` HOT 1
- Add `AssertInRange`
- Add `AssertGreaterOrEqual` and `AssertLessOrEqual`
- Make `FuzzUtilLimit` return random pieces of input set HOT 4
- Add `FuzzUtilRemoveDuplicates`
- Add `AssertUnique`
- Startup message cannot be disabled HOT 1
- Update CI to use go 1.19
- Snapshot saves slice capacities, failing when executing on different machines HOT 1
- Switch to `atomicgo/assert`
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 testza.