Bugfix storybook now works with live API data or with built tests

This commit is contained in:
2026-06-17 16:06:53 -07:00
parent f944c3aac6
commit 345152b548
5 changed files with 50 additions and 16 deletions
+18 -5
View File
@@ -13,15 +13,28 @@ const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(file
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
export default defineConfig({
plugins: [react(), jsconfigPaths()],
// --- ADDED THE SERVER PROXY HERE ---
server: {
proxy: {
'/api': {
target: 'http://vdap.org:8082', // The remote internet API
changeOrigin: true, // Tricks the remote server into accepting the request
secure: false, // Set to true later when you upgrade to HTTPS
},
},
},
// -----------------------------------
test: {
projects: [{
extends: true,
plugins: [
// The plugin will run tests for the stories defined in your Storybook config
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
storybookTest({
configDir: path.join(dirname, '.storybook')
})],
// The plugin will run tests for the stories defined in your Storybook config
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
storybookTest({
configDir: path.join(dirname, '.storybook')
})],
test: {
name: 'storybook',
browser: {