Skip to content

Commit

Permalink
Ensure state reading is called
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryuni committed Jun 20, 2024
1 parent 4b357c0 commit 8bd7bad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions package/tests/unit/with-plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ describe('withPlugins', () => {
},
};
},
'astro:server:done': () => ({
getState: () => innerState,
'astro:server:done': ({ logger }) => ({
getState: () => {
logger.info('Reading state');
return innerState;
},
}),
};
},
Expand Down Expand Up @@ -86,6 +89,7 @@ describe('withPlugins', () => {
expect(logger.log).toStrictEqual([
'Called from plugin "foo" on integration "my-integration".',
'Calling "foo" with msg: from integration',
'Reading state',
]);
});

Expand Down Expand Up @@ -150,6 +154,7 @@ describe('withPlugins', () => {

expect(logger.log).toStrictEqual([
'Called from plugin "foo" on integration "my-integration".',
'Reading state'
]);
});
});
Expand Down

0 comments on commit 8bd7bad

Please sign in to comment.