Comments (1)
I'll happily look into this if you like the idea.
Minimal implementation excluding support for test.each
and the done
-callback:
let collectedCallbacks = [];
global.beforeEachSuccessiveTest = (closure) => {
collectedCallbacks.push(closure);
};
const test = global.test;
["test", "it"].forEach((ident) => {
global[ident] = function (name, fn) {
const beforeCallbacks = collectedCallbacks.slice();
test.call(this, name, () => {
return runAll([...beforeCallbacks, fn]);
});
};
Object.assign(global[ident], test);
});
function runAll(callbacks) {
for (let i = 0; i < callbacks.length; i++) {
const value = callbacks[i]();
if (typeof value?.then === "function") {
return value.then(() => {
runAll(callbacks.slice(i + 1));
});
}
}
}
from jest.
Related Issues (20)
- [Feature]: Allow to customize the serializable properties during error report HOT 2
- [Bug]: Wrong diff for objectContaining
- [Feature]: Custom diff for custom asymmetric matcher
- [Docs]: Adopt OpenJS Code Of Conduct HOT 2
- [Feature]: toContainSnapshot and toContainInlineSnapshot
- [Bug]: Error Message links to URL with . at the end, causeing wrong url to be opened HOT 1
- [Bug]: Jest does not recognise Vite suffixes applied to imports HOT 1
- [Docs]: Update Footer On Jest Website
- [Feature]: Ability to dispatch spec files to jest non-interactively
- Failed build: Node Nightly CI HOT 16
- [Feature]: Report duplicate test names HOT 4
- [Bug]: Unexpected token 'export' when Jest test imports d3-array (3.2.4) HOT 1
- [Bug]: ReferenceError: CSS is not defined HOT 1
- [Feature]: Option to support `Error#cause` in snapshots for Jest29 HOT 4
- [Bug]: Using `projects` option does not "copy the root-level configuration options to each individual child configuration during the test run"
- [Feature]: The ability of `toHaveProperty` to parse dots in property name is so evil. Please remove it. HOT 1
- [Bug]: Error while running watch
- OpenJS Onboarding: Document Core Infrastructure By Filling Out Google Form HOT 1
- [Feature]: Support `import.meta.resolve` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest.