タグ

mockに関するyuhiiskのブックマーク (4)

  • API Docs

    fetch-mock fetch-mock allows mocking http requests made using fetch or a library imitating its api, such as node-fetch or fetch-ponyfill. It supports most JavaScript environments, including Node.js, web workers, service workers, and any browser that either supports fetch natively or that can have a fetch polyfill installed. As well as shorthand methods for the simplest use cases, it offers a flexi

  • Quick Tip: Mock REST APIs Using json-server — SitePoint

    Sometimes you need to prototype the front-end of your application without a back-end in place. Creating even a basic mock API to develop against can be time-consuming. The json-server library solves this problem for you by providing a fast and easy way to create complex RESTful APIs for development and testing. This quick tip will teach you how to create mock REST APIs using json-server, allowing

    Quick Tip: Mock REST APIs Using json-server — SitePoint
  • jquery.mockAjax でサーバ待ちしないさくさく開発を — ディノオープンラボラトリ

    ディノ日酒調達部員の sou です。こんにちは。 今日はAjax開発に便利なjQueryプラグインを紹介します。 ディノも昨年から JavaScript 案件が増えており、格的な JavaScript アプリケーションも実装するようになってきました。ただ、サーバサイドのみの開発に比べるとXMLHttpRequest経由でサーバサイドとのつなぎ込みが発生するので、問題の切り分けや実装スケジュール調整など難しい点もあるのではないでしょうか。 そんな時には jquery.mockAjax プラグインが便利です。 概要 これを使うと $.ajax のリクエスト先を条件に従い振り分ける事が出来、スクリプトや HTML の書き換え無しにサーバ側への通信をカットし、 ローカルファイルで用意した JSON や HTML フラグメントを代わりに持ってくる事が出来ます。 小さい&単純なコードですが、こ

  • jquery-mockjax 使えよ色々と捗るぞ - present

    jQuery や Backbone.js で UI を開発していて面倒なのが、サーバー側の API を呼び出す部分の実装です。呼び出したい API が既に実装されていないと、細かいところまで作り込めません。 あと、上手く動かなかったときも面倒です。原因がクライアント側ならすぐ直せますが、サーバー側だった場合、サーバー側のコードを修正して、テストまでしないといけません。効率悪いですよね。 できれば、クライアント側の開発はクライアント側だけで完結したい。さらに欲を言えば、最終的にサーバー側の API を呼び出すように修正するとき、出来るだけ少ない修正で済むようにしたい。 API 呼び出しを抽象化してダミーの処理と差し替えたり、jQuery.ajax を上書きしたり、色々工夫して最後に行き着いたのが『jquery-mockjax』。 appendto/jquery-mockjax · GitHu

    jquery-mockjax 使えよ色々と捗るぞ - present
  • 1