GithubHelp home page GithubHelp logo

Comments (3)

SimenB avatar SimenB commented on April 27, 2024

You can look at Jest like a sort task orchestrator. Runner then is what it manages (you can use this to e.g. run ESLint via Jest). A runner is executed once for every top level invocation (or watch mode re-run).

Test runner is used by Jest's builtin runner in order to run tests. The test runner is then either jest-circus or the legacy jest-jasmine, and that's what provides describe, test, expect to tests and reports back a result.

Does that make sense? Happy to take PRs to clarify the docs

from jest.

aaronvg avatar aaronvg commented on April 27, 2024

by top-level invocation, you mean when you run the Jest CLI right? I'll submit a clarification PR

from jest.

aaronvg avatar aaronvg commented on April 27, 2024

Which abstraction would help me set some context right before an individual test(..) or it(..) runs? Like setting an environment variable or asynclocalstorage for the things in the test to read?

Update: Found #7774 . What i really wanted was the test name so this should work I believe. If I have any other dynamic metadata (like some uuid I want to generate per test) I'll try the custom testRunner approach.

from jest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.