Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
TeyKey1 committed Dec 21, 2023
1 parent 59a5afc commit 5c333e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,4 @@
]
}
}
}
}
17 changes: 8 additions & 9 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,25 @@ const config: UserConfig = {
},
test: {
include: ['src/tests/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
pool: "forks", // Workaround as testing with threads causes segfaults (likely vitest bug) Caution: with this in place tests are not running in isolated threads!
pool: 'forks', // Workaround as testing with threads causes segfaults (likely vitest bug) Caution: with this in place tests are not running in isolated threads!
environment: 'jsdom',
environmentOptions: {
jsdom: {
resources: 'usable'

}
}
},
// Workaround as in svelte tests onMount is not called due to being in nodejs environment (SSR) see: https://github.com/testing-library/svelte-testing-library/issues/222#issuecomment-1588987135
// By directly importing the runtime we force Svelte to call it without onMount being replaced by noop
resolve: process.env.TEST
? {
alias: [
{
find: /^svelte$/,
replacement: path.join(__dirname, 'node_modules/svelte/src/runtime/index.js')
}
]
}
alias: [
{
find: /^svelte$/,
replacement: path.join(__dirname, 'node_modules/svelte/src/runtime/index.js')
}
]
}
: {}
};

Expand Down

0 comments on commit 5c333e7

Please sign in to comment.