question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
idecommented, Nov 27, 2018

I ended up using Jasmine for now so I probably won’t work on this soon.

1reaction
idecommented, Nov 27, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found