タグ

ブックマーク / kentcdodds.com (2)

  • Stop mocking fetch

    What's wrong with this test? // __tests__/checkout.js import * as React from 'react' import { render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { client } from '#app/utils/api-client' jest.mock('#app/utils/api-client') test('clicking "confirm" submits payment', async () => { const shoppingCart = buildShoppingCart() render(<Checkout shoppingCa

    Stop mocking fetch
    nc44v-134-nvtyqfgq
    nc44v-134-nvtyqfgq 2021/03/05
    Kent C. Dodds が api client の mock を避けるべきという文脈から msw を紹介していた。Node.js, browser 両方で network に intercept できる。ブラウザでは serviceWorker 使っている。setupFilesAfterEnv での設定例も載っていてよい
  • What open source project should I contribute to?

    What open source project should I contribute to?July 6th, 2020 — 6 min read This is a question I've had countless times: 𝕏 post data not available: https://twitter.com/sarna_pranu/status/672438850724175872 Pranu's first pull request came soon after tweeting this 𝕏 post data not available: https://twitter.com/geraldchecka/status/670445392706736128 And in direct messages, emails, etc. The general

    What open source project should I contribute to?
    nc44v-134-nvtyqfgq
    nc44v-134-nvtyqfgq 2020/07/14
    オープンソースにどう貢献すればいいか、貢献しやすいもののリソース集など
  • 1