Does @xstate/test support xstate V5? #4761
-
👋 Hey Community! I was starting a fresh project, so naturally I'm using xstate and nonetheless the V5. const toggleMachine = x.createMachine({
id: "toggle",
initial: "inactive",
states: {
inactive: {
on: {
TOGGLE: "active",
},
meta: {
test: async () => {
console.log("TEST INACTIVE");
},
},
},
active: {
on: {
TOGGLE: "inactive",
},
meta: {
test: async () => {
console.log("TEST ACTIVE");
},
},
},
},
});
const toggleModel = xt.createModel<{}>(toggleMachine).withEvents({
TOGGLE: {
exec: async () => {
// await page.click('input');
},
},
});
const testPlans = toggleModel.getShortestPathPlans();
testPlans.forEach((plan) => {
describe(plan.description, () => {
plan.paths.forEach((path) => {
it(path.description, async () => {
await path.test({});
});
});
});
}); |
Beta Was this translation helpful? Give feedback.
Answered by
davidkpiano
Feb 23, 2024
Replies: 1 comment 11 replies
-
Hey! Have you tried |
Beta Was this translation helpful? Give feedback.
11 replies
Answer selected by
iliasbhal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! Have you tried
@xstate/test@beta
?