Skip to content

Commit 044d69a

Browse files
authored
Merge pull request #2738 from valtterikantanen/patch-1
Update the content of `cypress.config.js` on osa5d.md
2 parents 68ed899 + 6f78448 commit 044d69a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/content/5/fi/osa5d.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ module.exports = defineConfig({
844844
Kaikki testeissä olevat sovelluksen osoitetta käyttävät komennot
845845
846846
```js
847-
cy.visit('http://localhost:3000' )
847+
cy.visit('http://localhost:3000')
848848
```
849849
850850
voidaan muuttaa muotoon
@@ -865,8 +865,12 @@ module.exports = defineConfig({
865865
setupNodeEvents(on, config) {
866866
},
867867
baseUrl: 'http://localhost:3000',
868-
BACKEND: 'http://localhost:3001/api' // highlight-line
869868
},
869+
// highlight-start
870+
env: {
871+
BACKEND: 'http://localhost:3001/api'
872+
}
873+
// highlight-end
870874
})
871875
```
872876
@@ -876,13 +880,13 @@ Korvataan testeistä kaikki backendin osoitteet seuraavaan tapaan
876880
describe('Note ', function() {
877881
beforeEach(function() {
878882
cy.visit('')
879-
cy.request('POST', `${Cypress.env('EXTERNAL_API')}/testing/reset`) // highlight-line
883+
cy.request('POST', `${Cypress.env('BACKEND')}/testing/reset`) // highlight-line
880884
const user = {
881885
name: 'Matti Luukkainen',
882886
username: 'mluukkai',
883887
password: 'salainen'
884888
}
885-
cy.request('POST', `${Cypress.env('EXTERNAL_API')}/users`, user) // highlight-line
889+
cy.request('POST', `${Cypress.env('BACKEND')}/users`, user) // highlight-line
886890
})
887891
// ...
888892
})

0 commit comments

Comments
 (0)