Running Jest (namely jest-circus) outside of Node
See original GitHub issue🚀 Feature Proposal
I am looking at running jest-circus outside of Node and it mostly works but there are some transitive dependencies on Node built-ins like fs
that don’t make a lot of sense in non-Node environments. This is a proposal to make jest-circus run outside of Node and add a test to keep it running.
Motivation
The motivation is to run Jest tests fully outside of Node to test running in an authentic environment as opposed to the use case for more pure JS.
Example
E.g. use Webpack to create a bundle with jest-circus.
Pitch
This change needs to be made to jest-circus itself. One concrete suggestion is to split jest-util into two packages, jest-util and jest-pure-utils/jest-universal-utils (no dependencies on non-pure modules) and for jest-circus to use jest-pure-utils.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:10 (6 by maintainers)
Top Results From Across the Web
jest-circus-allure-environment - npm package - Snyk
We found indications that jest-circus-allure-environment is an Inactive project. See the full package health analysis to learn more about the package ...
Read more >jest-circus | Yarn - Package Manager
Overview. Circus is a flux-based test runner for Jest that is fast, maintainable, and simple to extend. Circus allows you to bind to...
Read more >[jest-circus] missing fail() method · Issue #11698 - GitHub
After upgrading to Jest v27 (with jest-circus as default) the fail() method is no longer defined. ReferenceError: fail is not defined. Last ...
Read more >Configuring Jest
Jest will run .mjs and .js files with nearest package.json 's type field set to module as ECMAScript Modules.
Read more >jest-circus - npm
Start using jest-circus in your project by running `npm i jest-circus`. There are 742 other projects in the npm registry using jest-circus.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I ended up using Jasmine for now so I probably won’t work on this soon.
I was trying to run jest-circus on a phone (web & Expo) to run tests on a real device like
expect(someDeviceApi()).toBe(...)
. jest-circus used to run outside of Node when it was first in beta but as @aaronabramov mentioned some more dependencies were added.