Skip to content

Help making a source/test jest config work #193

Description

@toddscan

I'm using the .projectionist.json config from this gist:

https://gist.github.com/mthadley/e5389f45b4fb951be067fe42357d679d

but altered slightly for my naming conventions:

{
	"**/__tests__/*.spec.tsx": {
		"alternate": "{}.tsx",
		"type": "test"
	},
	"*.tsx": {
		"alternate": "{dirname}/__tests__/{basename}.spec.tsx",
		"type": "source"
	}
}

The source matcher works as expected, but reversing that from the test matcher does this:

E345: Cannot find file "/Users/<user>/<project>/<repo>/app/javascript/src/features/<feature>/<subdir>/__tests__/__tests__/<component>.spec.spec.tsx" 

I've tried changing test to use basename, dirname, file, and variations on ../{}.tsx all to no avail. How do I make this work?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions