Bugfix storybook now works with live API data or with built tests
This commit is contained in:
+18
-5
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user