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

Pattern mode usage doesn't autocomplete spec test file routes #6481

Closed
dortamiguel opened this issue Jun 16, 2018 · 5 comments
Closed

Pattern mode usage doesn't autocomplete spec test file routes #6481

dortamiguel opened this issue Jun 16, 2018 · 5 comments

Comments

@dortamiguel
Copy link

🐛 Bug Report

When I'm in "Pattern Mode Usage" while running jest with "jest --watch" if I type a valid name for an .spec files the route doesn't gets autocompleted below the line "pattern >"

Maybe is related with my .jestconfig?

const jestConfig = {
	moduleFileExtensions: ['ts', 'tsx', 'js'],
	globals: {
		'ts-jest': {
			useBabelrc: true,
		},
	},
	transform: {
		'^.+\\.tsx?$': 'ts-jest',
		'^.+\\.jsx?$': 'babel-jest',
	},
	moduleNameMapper: {
		'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
			'identity-obj-proxy',
	},
	testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
	coveragePathIgnorePatterns: ['.*\\.d\\.ts', '<rootDir>/node_modules/'],
}

if (process.env.COVERAGE === 'all') {
	jestConfig.collectCoverageFrom = ['src/**/*.js', 'src/**/*.ts']
}

module.exports = jestConfig
@dortamiguel
Copy link
Author

dortamiguel commented Jun 18, 2018

I have more info.

If I run

jest --watch

and then press p the option called "Press p to filter by a filename regex pattern."

I get this screen

image

The thing is that while I type I don't get any file path suggestion, but when I press enter the regex filter gets applied. As you can see in this screenshot

image

There is something wrong with my config. I read the docs a dozen of times and tried loads of different example config files. I'm missing something?

@mikehdt
Copy link

mikehdt commented Jun 18, 2018

IIRC there was some license-type issues around the typeahead (autocomplete) stuff. It seems this may be what you're after:
https://github.com/jest-community/jest-watch-typeahead

If indeed that's the case, it would be good if the Jest documentation helped point towards it 😃

(Further discussion can be found here: #4931 )

@rickhanlonii
Copy link
Member

rickhanlonii commented Jun 19, 2018

Yeah @mikehdt is right - you'll need the plugin for typeahead

Happy to merge a docs PR that mentions it, but closing this as not a bug

@dortamiguel
Copy link
Author

Thank you 🙂

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants