A retrospective of how Astro migrated more than 500 test suites from Mocha to Node.js test runner.

上記以外で特筆すべき点として、他の開発者(≒チームメンバー)にとっては、変更の影響をほとんど受けずに、ノーコストで上記恩恵を受けられる点があります。 これは Vitest の Jest に対する高い互換性のおかげでテストコードの書き方に大きな変更がなかったことと、テスト実行コマンドを npm-scripts によって隠蔽していたことによるもので、移行したことに気づきさえしない可能性もあります。 Vite を使ってないのに Vitest 使ってええんか? 今回 Jest から Vitest への移行を行ったプロジェクトは、開発サーバーやプロダクションビルドには Webpack を使用しており、Vite は一切使用していませんでした。 そういったプロジェクトにおいても、Vite をベースとしたテストフレームワークである Vitest は使用して良いものでしょうか? これについては Vitest
About the sweet and powerful 'use case' code patternA compilation of outstanding testing articles (with JavaScript)Testing the dark scenarios of your Node.js applicationPractica v0.0.6 is aliveIs Prisma better than your 'traditional' ORM?
A couple of months ago I have announced a Cypress.io course Testing The Swag Store targeted at the beginners who want to learn web end-to-end and component testing using Cypress.io test runner. The short announcement video can be seen below It is hard to believe, but I have been on a roll creating lots and lots of lessons for this course. It now covers end-to-end testing, React component testing,
TL;DR フロントエンドのテストが壊れやすく要因の一つは、ユーザがどのようにソフトウェアを使うかをクエリに反映できていないからかも testing-library はソフトウェアを使うユーザの気持ちを反映させやすいようにクエリの優先度をつけていて、それに従うほうがいい 優先度の低いクエリも役に立つことがある 運用しているアクセシビリティなどの実装のガイドラインに沿うようなテストを作るとき アクセシビリティの低い実装をリファクタリングするためのテストを作るとき はじめに フロントエンドのテストに用いるツールとして testing-library が知られています。testing-library は提供しているクエリに優先度をつけています。この優先度は、どういう基準でつけられているのでしょうか。 この記事では、 testing-library のガイドを読みながら、クエリの優先度を「ユーザの
Our team is a couple of months into developing a new application, and our suite of unit 240 tests takes 46 seconds to run. That duration is not excessive yet, but it’s increasing in proportion to the number of tests. In a couple of months, it’ll take a couple of minutes to run our tests. We were surprised by this, as Jest is known for its fast performance. However, while Jest reported that each te
課題link お手伝いしているシステムでNestJSを採用しているバックエンドのテストが遅いという課題があったので対処した。 前提link フレームワークDBテストランナーその他 テストの総数は700弱。 最終結果link 最終的には2段階の改修を経てローカルのテストが3倍速程度高速化した。 # before Test Suites: 145 passed, 145 total Tests: 2 skipped, 681 passed, 683 total Snapshots: 0 total Time: 925.063 s Ran all test suites. Done in 926.48s. # ts-jestを@swc/jestに置き換えた Test Suites: 145 passed, 145 total Tests: 2 skipped, 681 passed, 683 t
Meta Open Source is transferring Jest to the OpenJS Foundation Meta Open Source is officially transferring Jest, its open source JavaScript testing framework, to the OpenJS Foundation. With over 17 million weekly downloads and over 38,000 GitHub stars, Jest is the most used testing framework in the JavaScript ecosystem and is used by companies of all sizes, including Amazon, Google, Microsoft, and
Undici is a fast, reliable, and spec-compliant HTTP/1.1 client that is written from scratch and represents the evolution of the Node.js HTTP stack. It is quickly becoming one of the most popular packages out there, with almost half a million weekly downloads on npm. And if you don’t believe us, check out this tweet from Node.js TSC member Matteo Collina. Because Undici re-invents HTTP primitives a
概要 JavaScript/TypeScript向けのMutation Testing FrameworkであるStryker-jsがいい感じになってきたので紹介してみます。簡単な紹介のみです。 対象読者 Strykerの概要を知りたい人 Mutation Testingよく知らないJSer/TSer Mutation Testing導入したいけどJS/TS用のツールが見つからなかった人 Mutation Testingとは テスト対象のコードを変更(Mutate)するミュータントを仕込み、Unit Testが正しくそれらのミュータントを退治できるか測定するものです。 一般的には退治できた割合が高いほど意味のあるUnit Testを書いていると言えます。 Wikipediaの項目にもある通りFuzzingの一種とも言えます。 Mutation Testing自体はGoogleが論文出してた
Table of contentsWhy compare these automation tools?Methodology, or how we ran the benchmarkThe resultsConclusionOur recent speed comparison of major headless browser automation tools, namely Puppeteer, Playwright and WebDriverIO with DevTools and Selenium, received a very positive response. The single most common ask from our readers was that we follow up by including Cypress in our benchmark. In
Jest is a simple testing library that works with zero configuration. Because of its great API - if you're already using Mocha - with a few find & replace and minimal effort, you can move to Jest without rewriting any of your tests. In this post, I'll show you how I tweaked my existing Mocha setup to achieve this. If you're new to Jest, don't forget to check out their Getting Started page as well.
Creating an Object Validator in JavaScript the Test-Driven Development Way Introduction Test-Driven Development (TDD) seems like a great concept, but it’s hard to fully understand and appreciate until you see it in action. In this blog post, we’re going to implement a JavaScript object validator using TDD. A Quick Primer on Test-Driven Development TDD flips a lot of “conventional” software develop
技術書、ブログ、READMEを書いてていて、文章中に出てくるコードブロックのコードをテストしたいことがあると思います。 そのサンプルコードが本当に動いてるのか不安になることがあるからです。 power-doctestは、そのコードブロック中のコードにコメントを入れるだけでテスト可能にするツール群です。 power-doctestの例 具体的な例から見ていきます。 次の例では、Markdownで説明とJavaScriptのコードブロックを書いています。 デフォルト引数を使って書くことで、このような挙動は起きなくなるため安全です。 デフォルト引数では、引数が渡されなかった場合のみデフォルト値が入ります。 ```js function addPrefix(text, prefix = "デフォルト:") { return prefix + text; } // falsyな値を渡してもデフォルト
April 12, 2019The perfect unit testThere's a common theme I find with people who tell me that they don't find unit testing useful, and it's normally that they are writing bad tests. This is completely understandable, particularly if you're newer to unit testing. It's hard to write good tests and it takes practice to get there. All the things we're going to talk about today were learned the hard wa
It’s been almost a year since my posts on Excel workbook snapshot testing and PDF snapshot testing. Both of these have proven to be very valuable in our automated test suite and have allowed us to easily catch regressions, manually inspect the differences, and then update as needed. Another task on my current project has allowed me to revisit this approach—this time for snapshot testing of the HTM
The Page Object pattern is certainly the most utilized pattern when it comes to web application test automation. It is a powerful method for reducing code maintenance costs and code duplication which leads to increase of the re-usability and robustness. All this benefits become apparent when you're testing complex large scale applications. And we all know that large and complex applications only t
27 October, 2018 The Three Types of Performance Testing Written by Harry Roberts on CSS Wizardry. Table of Contents Proactive Reactive Passive What This Means for Developers What This Means for the Business A lot of companies—even if they are aware that performance is key to their business—are often unsure of how, when,
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く