Skip to content

Commit ead161f

Browse files
committed
add watch mode
1 parent d93eecb commit ead161f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
- name: Run tests 🧪
1111
# https://github.com/cypress-io/github-action
12-
uses: cypress-io/github-action@v4
12+
uses: cypress-io/github-action@v5
1313
with:
1414
build: npm test
1515
start: npm start
@@ -18,7 +18,7 @@ jobs:
1818
run: git checkout ./cypress/fixtures/data.json
1919

2020
- name: Run JSON server tests 🧪
21-
uses: cypress-io/github-action@v4
21+
uses: cypress-io/github-action@v5
2222
with:
2323
# we have already installed all dependencies above
2424
install: false

cypress/fixtures/example-server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const dataFilename = path.join(__dirname, 'data.json')
77
// create json server and its router first
88
const server = jsonServer.create()
99
const router = jsonServer.router(dataFilename)
10+
11+
console.log('db', router.db.getState())
12+
1013
server.use(
1114
jsonServer.defaults({
1215
bodyParser: true,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"cy:open:4000": "cypress open --config baseUrl=http://localhost:4000",
4242
"start": "json-server cypress/fixtures/data.json --middlewares ./src/index.js --middlewares ./src/merge",
4343
"start:server": "node ./cypress/fixtures/example-server",
44+
"watch:server": "node --watch ./cypress/fixtures/example-server",
4445
"e2e": "start-server-and-test 3000 cy:run",
4546
"dev": "start-server-and-test 3000 cy:open",
4647
"dev2": "start-test start:server 4000 cy:open:4000",

0 commit comments

Comments
 (0)