並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 5 件 / 5件

新着順 人気順

Mockの検索結果1 - 5 件 / 5件

  • 自動テストはなぜうまくいかないか?乗り越えるためには何が必要か? - Qiita

    リファクタリングの鶏卵問題 ソースコードがクソなので綺麗にしたい。 リファクタリングしたい。 しかし、リファクタリングが出来ない。 リファクタリングが出来ないのは、テストが無いからだ。 よし。じゃあテストを書こう。あれ、テストが書けない? そのようなテストが無く、書き換えられないことによる矛盾や憤りは皆さん何百回と感じてきたと思います。 しかし、この「テストが出来ない」ということを言語化するのは、非常に難しいと思います。それは、「テストが出来ない」には実は2つの視点があります。 本質的にテストが困難なモジュールで、誰がやってもテストが書けない。 本質的にモジュールはテスト可能だが、自分の実力が足りず、自分ではテストが書けない。 1.のようなテスト困難なモジュールは誰がやってもテストは書けないです。しかし、問題は、「テストを書きたい」と思ったとき、「自分がそれほどテストに詳しくない」という場

      自動テストはなぜうまくいかないか?乗り越えるためには何が必要か? - Qiita
    • GitHub - stackframe-projects/pgmock: In-memory Postgres for unit/E2E tests

      You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

        GitHub - stackframe-projects/pgmock: In-memory Postgres for unit/E2E tests
      • Increase Test Fidelity By Avoiding Mocks

        Post a Comment The comments you read and contribute here belong only to the person who posted them. We reserve the right to remove off-topic comments. TotT 91 GTAC 61 James Whittaker 42 Misko Hevery 32 Anthony Vallone 27 Code Health 23 Patrick Copeland 23 Jobs 18 Andrew Trenk 12 C++ 11 Patrik Höglund 8 JavaScript 7 Allen Hutchison 6 George Pirocanac 6 Zhanyong Wan 6 Harry Robinson 5 Java 5 Julian

          Increase Test Fidelity By Avoiding Mocks
        • Release v2.0.0 · mswjs/msw

          Important This release is a BREAKING CHANGE. Please follow the Migration guidelines to upgrade. This release took a lot of effort to make, and I expect a bit of that effort on your part while upgrading. Most of the changes are mechanical, and a simple Find/Replace All will get you a long way. For the rest of it, you will learn how to handle requests and responses using the standard JavaScript API.

            Release v2.0.0 · mswjs/msw
          • Vitest のモック関数 fn、spyOn、mock の使い分け - Qiita

            はじめに この記事では、Vitest というテストフレームワークのモックに利用される vi.fn、vi.spyOn、vi.mock の概要とそれらの使い分けをサンプルつきで記載していきます。 fn、spyOn、mock の使い分け モック対象によって使い分けます。 fn:関数 spyOn:オブジェクトのメソッド mock:モジュール全体 fn fn は、関数をモックします。 以下のサンプルでは、getApples というモック関数を作成し、その関数が呼び出されることをテストしています。 test("spy function no arguments and no returns", () => { // Define mock function const getApples = vi.fn(); // call mock function getApples(); // check if

              Vitest のモック関数 fn、spyOn、mock の使い分け - Qiita
            1