Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Nov 21, 2024
1 parent 1ef1672 commit a5d977c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/astro/test/units/sessions/astro-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const defaultMockCookies = {
get: () => 'sessionid',
};

const stringify = (data) => '0' + devalueStringify(data);
const stringify = (data) => JSON.parse(devalueStringify(data))

const defaultConfig = {
driver: 'memory',
Expand All @@ -19,7 +19,7 @@ const defaultConfig = {
// Helper to create a new session instance with mocked dependencies
function createSession(config = defaultConfig, cookies = defaultMockCookies, mockStorage) {
if (mockStorage) {
config.driver = 'custom';
config.driver = 'test';
config.options ??= {};
config.options.mockStorage = mockStorage;
}
Expand Down Expand Up @@ -406,7 +406,7 @@ test('AstroSession - Storage Errors', async (t) => {

await assert.rejects(
async () => await session.get('key'),
/The session data could not be parsed/,
/The session data was an invalid type/,
);
});
});

0 comments on commit a5d977c

Please sign in to comment.