Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support context alias for describe #165

Open
blimmer opened this issue Apr 27, 2021 · 3 comments · Fixed by #178
Open

Support context alias for describe #165

blimmer opened this issue Apr 27, 2021 · 3 comments · Fixed by #178

Comments

@blimmer
Copy link
Contributor

blimmer commented Apr 27, 2021

I'm currently working with a client who's migrating from mocha over to jest. They've gotten used to using context in mocha (which is just an alias for describe) to structure their tests.

So, in their codebase, I'm simply aliasing context to describe, as suggested in this thread: jestjs/jest#2468

However, I'm running into some problems with the runner because it's not looking for context (just describe)

for (const element of children) {
if (element.type === 'describe' && selectedLine === element.start.line) {
return resolveTestNameStringInterpolation(element.name);
}
if (element.type !== 'describe' && selectedLine >= element.start.line && selectedLine <= element.end.line) {
return resolveTestNameStringInterpolation(element.name);
}
}

It would be nice if I could configure the plugin to look for describe as well as context when generating the targetted test name.

@blimmer
Copy link
Contributor Author

blimmer commented May 28, 2021

I was looking into this today and realized that this would need to be supported in jest-editor-support, I think. I opened jest-community/jest-editor-support#73 to track that.

@blimmer
Copy link
Contributor Author

blimmer commented Jun 2, 2021

Hey @firsttris - whoops, it looks like this issue got closed by #178. Could we reopen it? I don't see an option to reopen from my end.

@firsttris firsttris reopened this Jun 3, 2021
@firsttris
Copy link
Owner

hey @blimmer thx for noticing

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

Successfully merging a pull request may close this issue.

2 participants