Giter VIP home page Giter VIP logo

Comments (6)

jamestelfer avatar jamestelfer commented on August 19, 2024 1

HTH. I'm enjoying the library: great output, and the snapshot functions are really useful. Thanks!

from testza.

MarvinJWendt avatar MarvinJWendt commented on August 19, 2024

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.

jamestelfer avatar jamestelfer commented on August 19, 2024

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.

jamestelfer avatar jamestelfer commented on August 19, 2024

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.

jamestelfer avatar jamestelfer commented on August 19, 2024

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.

MarvinJWendt avatar MarvinJWendt commented on August 19, 2024

Hi @jamestelfer, thanks for the PR! I am currently looking into it, and it looks good.

from testza.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.