Coder Social home page Coder Social logo

Mock tests 591 API response about zuzugo HOT 2 CLOSED

yukaii avatar yukaii commented on June 1, 2024
Mock tests 591 API response

from zuzugo.

Comments (2)

Yukaii avatar Yukaii commented on June 1, 2024

範例:https://github.com/hackmdio/api-client/blob/develop/nodejs/tests/mock/index.ts

https://github.com/mswjs/msw

from zuzugo.

Yukaii avatar Yukaii commented on June 1, 2024

目前測試中有用到 getHouseList 真的去呼叫 591 server 的是:

  • getToken.spec.ts
  • houseType.spec.ts

其中,平常跑 unit test 時希望能啟用 msw,讓 response 變成 mock 的。其中 mock 的 JSON 值已經在 tests/fixtures/rsLists.json

每天會加跑一次驗證 591 資料格式的 Cron Job:

run: pnpm test -- -t "validate"

希望能加入環境變數 ZUZUGO_TEST_REALWORLD (boolean),讓平常測試時使用 msw 的 mock 回應,但每日 cron job 使用實際的 server 回應

from zuzugo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.