Your progress is saved locally. to save it permanently.

0 of 2 steps0%

Start the same mock with postman mock run against your scenario .js file, add a CI workflow, push to your public fork, and confirm the GitHub Action health-checks the mock.

1

Start the Mock with the Postman CLI

Use postman mock run against the scenario .js file (not the mock folder — a directory fails with EISDIR). Same command you'll use in CI.

  1. If the mock is still running in the Postman UI, click Stop so the port is free. Keep the real Deskly Express app stopped as well.

  2. Open the Postman terminal (or any terminal) in your connected deskly-api folder.

  3. Confirm the Postman CLI is available:

    postman --version

    If the command isn't found, install the CLI from the Postman CLI docs, then retry.

  4. Find your mock's scenario script and the port it listens on. In Files, expand postman/mocks/ — you should see a folder for Deskly Mock containing config.yaml and a .js file (often default.js). Open config.yaml and note the port (commonly 4500).

  5. Start the mock by pointing at that .js file (adjust the folder and filename if yours differ):

    postman mock run ./postman/mocks/deskly-mock/default.js

    Caution: Pass the scenario .js path, not the mock directory and not config.yaml. The CLI uses the port from config.yaml.

  6. In a second terminal (or a new Postman request), hit the mock on the port from config.yaml:

    curl http://localhost:4500/health

    Swap 4500 for whatever port your config.yaml lists. Expect a successful JSON response from your handler — still with no npm start for Deskly.

  7. Stop the CLI mock with Ctrl+C when you're finished.

Troubleshooting

  • EISDIR: illegal operation on a directory, read — you pointed postman mock run at a folder. Use the full path to the scenario .js file instead.
  • Connection refused — confirm the port in the curl matches config.yaml, and that nothing else (including the Postman UI mock) is already bound to it.

Reference: Mock server commands (postman mock run).

2

Add a CI Workflow and Push Your Mock to GitHub

Add a GitHub Actions workflow, push the mock and workflow to a feature/ branch, then open the Action run and confirm the health check hit your mock.

  1. In your editor (or the Postman Files tree), create a workflow file under .github/workflows/ named either deskly-mock-ci.yml or deskly-mock-ci.yaml — both extensions are valid. Use content like:

    name: Deskly mock smoke
    
    on:
      push:
        branches: ["feature/**"]
      pull_request:
    
    jobs:
      mock-smoke:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
    
          - name: Setup Node
            uses: actions/setup-node@v4
            with:
              node-version: "24"
    
          - name: Install Postman CLI
            run: npm install -g postman-cli
    
          # Stand-in for Deskly — no npm install / npm start for the Express app.
          # Point at the scenario .js file (not the mock directory).
          # The trailing & starts the mock in the background so the next steps can curl it.
          - name: Start Deskly mock
            run: postman mock run ./postman/mocks/deskly-mock/default.js &
    
          - name: Wait for mock
            run: |
              for i in $(seq 1 30); do
                if curl -sf http://localhost:4500/health; then
                  exit 0
                fi
                sleep 1
              done
              echo "Mock did not become ready in time" >&2
              exit 1
    
          - name: Smoke request against mock
            run: curl -sf http://localhost:4500/health
  2. Adjust the .js path and port in the workflow if your mock folder, scenario filename, or config.yaml port differ. The & at the end of the start step is intentional — it runs the mock in the background so the wait/smoke steps can hit it in the same job. Notice there is no step that runs Deskly's npm start — in a fuller pipeline you might follow this with postman collection run pointed at the same mock base URL.

  3. Open the Postman terminal and confirm you're in your connected deskly-api folder.

  4. Stay on your current feature/ branch, or create one dedicated to the mock:

    git checkout -b feature/deskly-mock
  5. Review what changed:

    git status -u

    Expect new or modified files under postman/mocks/ (and possibly .postman/resources.yaml) plus .github/workflows/deskly-mock-ci.yml or .github/workflows/deskly-mock-ci.yaml.

  6. Stage, commit, and push to your fork:

    git add .
    git commit -m "Add Deskly coded mock stand-in via Native Git"
    git push -u origin HEAD
  7. On GitHub, open your deskly-api fork → Actions. Select the Deskly mock smoke workflow run for the commit you just pushed on your feature/ branch (if Actions asks you to enable workflows on the fork, turn them on and re-run or push an empty commit).

  8. Open that run and expand a few steps — especially Wait for mock and Smoke request against mock. Confirm they curl http://localhost:4500/health (or your mock port) and complete successfully. That output is your proof the pipeline talked to the coded mock, not the Express app.

That's enough for this module. LiftOff checks your public fork for both artifacts on a feature/ branch — the coded mock under postman/mocks/ and the CI workflow that runs postman mock run.

Troubleshooting

  • postman/mocks/ missing from git status — create the mock in Local View (Part 2), not Cloud View, and confirm the folder is connected.
  • Workflow missing — add .github/workflows/deskly-mock-ci.yml or .github/workflows/deskly-mock-ci.yaml with postman mock run pointed at a .js file.
  • No run in Actions — enable Actions on the fork if prompted; confirm the branch name matches feature/** in the workflow on.push.branches filter.
  • Push rejected — run git pull --rebase origin <your-branch> and push again.
  • Validation can't see the repo — the fork must stay public (private repos return 404 to unauthenticated reads).