Skip to content

Instantly share code, notes, and snippets.

@mthadley
Last active October 21, 2022 16:14
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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"
}
}
@alex-shamshurin
Copy link

alex-shamshurin commented Jun 15, 2019

File extension must be 'json'

@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