投稿時間:2022-09-05 02:08:35 RSSフィード2022-09-05 02:00 分まとめ(10件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… 「iPhone 14」シリーズの仕様や価格が記載された資料?? − 「iPhone 13」シリーズとの比較も https://taisy0.com/2022/09/05/160968.html iphone 2022-09-04 16:13:38
python Pythonタグが付けられた新着投稿 - Qiita Windowsでmoviepyを使用する際に、TextClipに日本語が描画されない問題 https://qiita.com/masachaco/items/75ac0d59bafe11231a14 moviepy 2022-09-05 01:28:46
python Pythonタグが付けられた新着投稿 - Qiita Azure Functions の Python をバージョンアップしてみました https://qiita.com/turupon/items/6e058749cab99f322b13 azurefunctions 2022-09-05 01:25:55
js JavaScriptタグが付けられた新着投稿 - Qiita 【JS初心者向け】変数の使い分け(let、const、var) https://qiita.com/maidchan1234567/items/d2d75c118f89c7c6f861 const 2022-09-05 01:53:22
Azure Azureタグが付けられた新着投稿 - Qiita Azure Functions の Python をバージョンアップしてみました https://qiita.com/turupon/items/6e058749cab99f322b13 azurefunctions 2022-09-05 01:25:55
海外TECH DEV Community Do tests without seeing the code! https://dev.to/noriller/do-tests-without-seeing-the-code-1500 Do tests without seeing the code Especially if you re starting with automated tests You ve written the code you manually tested and it works maybe at least for the cases you ve used Maybe you are fed up with bugs appearing in production or you have some annoying coworker always nagging about tests well…sorry not sorry it s for your own good and for my sanity Integration testsFor doing this unit tests can have a smaller scope so integration is the way to go In the front end pick the functionality of a whole page Just the page not the header sidebar unless you re testing that The best case scenario you would be using something like MirageJS MSW or even JSON Server but mocking fetch is always an option In the backend test a whole route or handler in the controller The best case scenario would be using an ORM with migrations and seeders with the alternative being mocking the repositories you need Why test without seeing the codeIn other posts I commented on how it s easy to end up testing what you know the code s supposed to do and not what it s actually doing This happens because you get tunnel vision after all you already know it works But then again you re focused on one thing and not everything everywhere all at once Testing as if it s a black box will help you think as the user will They don t know that they can t do this or that or that you re expecting an array there and not an object Testing what you know works is just the beginning the real fun happens when you start thinking about ways and inputs that are wrong and how they will break your “perfect code I m not saying you need coverage but at least the expected mistakes and unhappy paths should be covered after the happy ones user without authentication or the requirements needed inputting the wrong things going back and forth steps… Another moment you can do that is when you re handed down something without any tests as I was Without tests it makes it harder to refactor and add new features But knowing you don t need to see the code to have a sufficient safety net makes you actually look forward to starting playing around with the code How to FrontendI m using and considering you re also using the Testing Library to test here All you need to know from the code is the main component to render you ll also probably need a custom render with whatever contexts you use Now all you need to do is open the front end and go step by step on what you re doing there and put that as code in the test Render the component what should you be seeing there s an extension to help you there If you need to fetch even if you re going to mock fetch directly all you need is to check the devtools in the network tab check where it s pointing and with what arguments body method…then check what it s returning and copy paste all of that in a test Then whatever action you need to take click type… you do using user event and check if whatever should be happened next was Rinse repeat and get annoyed when you can t easily access what you want because everything is divs without accessible roles BackendIf you have ORM migrations and seeds then you can use something like supertest just make sure to test how to have a clean state before each test and test what you should receive passing calling the path you want Depending on how you re structuring your app and files sometimes unit testing is the easier and faster way to go Usually you have controller ⇒service ⇒repository ⇒db If you have clear boundaries between those the controller parses the arguments it needs initiates dependencies and calls the servicethe service has whatever business rules you need and calls the repositoryrepository transform in calls to the DB and returns the data in an objectthe service has more business rules and returns errors or something elsethe controller will return the proper status code with payload depending on what it receivedThis means that with proper boundaries the service can be almost “pure in the sense that by itself it should always return the same results given the same inputs The test will start mocks for the repository calls the service and pass the mocks instead of the original implementations and in turn you test whatever it received given what you ve called it with and what you put in the mocks Yes this would be unit testing but I urge you to ignore the code and test as if it was a black box Same as with front end fire the app and check what it would be receiving from controller repository and what it would be returning Cover art made in WombotI wanted something along the lines of “programmer testing software with eyes covered Gotta share here some of the other weird results 2022-09-04 16:46:39
ニュース BBC News - Home Tallaght, Dublin: Three siblings killed in 'violent incident' https://www.bbc.co.uk/news/world-europe-62785466?at_medium=RSS&at_campaign=KARANGA cawley 2022-09-04 16:25:25
ニュース BBC News - Home Premier League to review VAR decisions with PGMOL https://www.bbc.co.uk/sport/football/62787324?at_medium=RSS&at_campaign=KARANGA pgmol 2022-09-04 16:00:55
ニュース BBC News - Home Hull City 0-2 Sheffield United: Oli McBurnie and Sander Berge send Blades back to the top https://www.bbc.co.uk/sport/football/62704198?at_medium=RSS&at_campaign=KARANGA Hull City Sheffield United Oli McBurnie and Sander Berge send Blades back to the topGoals from in form Oli McBurnie and Sander Berge help Sheffield United beat Hull City to reclaim the early lead in the Championship table 2022-09-04 16:44:56
北海道 北海道新聞 女子中学生連れ回した疑い 未成年者誘拐容疑で男女3人逮捕 旭川 https://www.hokkaido-np.co.jp/article/726283/ 女子中学生 2022-09-05 01:10:57

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)