jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.29k stars 6.47k forks source link

Is there a way to tell Jest (lib or CLI) to run only a specific file, or to custom boot like in Jasmine? #623

Closed jedwards1211 closed 9 years ago

jedwards1211 commented 9 years ago

Currently I run Jasmine tests inside of Webpack bundles in the following way:

This workflow is simple, easy to understand, and easy to customize for me. In contrast, it appears that Jest loads all files in __tests__ directories, this behavior can't be overridden, and the documentation for Webpack integration clarify any details of the following:

However, if I can simply run Webpack myself and tell Jest what bundle to run, it seems to me it would work like a charm.

Or, for even more flexibility (for example if I want to run Jest integration tests inside of Meteor) it would be nice if I could custom boot Jest just like one can custom boot Jasmine. The only way to get Meteor globals on scope in the browser or node is to have Meteor call my code. That means I can't have Jest call my code; I have to call Jest myself inside of my code called by Meteor.

jedwards1211 commented 9 years ago

After reading through the config options more, it looks like I'll be able to get Jest to load a pre-webpacked bundle. I'll go ahead and close this, and if any issues with running it that way come up, I'll reopen it.

github-actions[bot] commented 3 years ago

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.