Skip to content

Instantly share code, notes, and snippets.

@mthadley
Last active October 21, 2022 16:14
Show Gist options
  • Save mthadley/e5389f45b4fb951be067fe42357d679d to your computer and use it in GitHub Desktop.
Save mthadley/e5389f45b4fb951be067fe42357d679d to your computer and use it in GitHub Desktop.
A configuration for using vim-projectionist with jest. I was looking for this but couldn't find it anywhere.
{
"**/__tests__/*.js": {
"alternate": "{}.js",
"type": "test"
},
"*.js": {
"alternate": "{dirname}/__tests__/{basename}.js",
"type": "source"
}
}
@jackkinsella
Copy link

For my React Typescript code, where the convention was that tests were in a __tests__ folder and named X.test.tsx, I used the following

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

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