File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -902,8 +902,10 @@ module.exports = defineConfig({
902902 setupNodeEvents (on , config ) {
903903 },
904904 baseUrl: ' http://localhost:3000' ,
905- BACKEND : ' http://localhost:3001/api' // highlight-line
906905 },
906+ env: {
907+ BACKEND : ' http://localhost:3001/api' // highlight-line
908+ }
907909})
908910` ` `
909911
@@ -912,14 +914,15 @@ Let's replace all the backend addresses from the tests in the following way
912914` ` ` js
913915describe (' Note ' , function () {
914916 beforeEach (function () {
915- cy . visit ( ' ' )
916- cy .request (' POST' , ` ${ Cypress .env (' EXTERNAL_API ' )} /testing/reset` ) // highlight-line
917+
918+ cy .request (' POST' , ` ${ Cypress .env (' BACKEND ' )} /testing/reset` ) // highlight-line
917919 const user = {
918920 name: ' Matti Luukkainen' ,
919921 username: ' mluukkai' ,
920922 password: ' secret'
921923 }
922- cy .request (' POST' , ` ${ Cypress .env (' EXTERNAL_API' )} /users` , user) // highlight-line
924+ cy .request (' POST' , ` ${ Cypress .env (' BACKEND' )} /users` , user) // highlight-line
925+ cy .visit (' ' )
923926 })
924927 // ...
925928})
You can’t perform that action at this time.
0 commit comments