...data and validate it against your own records before acting on it. You can test LLM-calling code without hitting the API in your test suite, using the techniques from...
...build pipeline bundles it. You can evaluate a library before adding it โ maintenance, popularity, tests, dependencies, size โ and prefer boring technology over the newest option. You can explain why the...
...keep maintaining the library if the original author stops doing so. Does it contain tests? The code quality of our libraries should generally be around the same level of our...
...expressions extract structured data from text. This lesson teaches you to write, read and test them, and shows where they are the right tool and where they aren't.
...pattern readable, e.g. with the /x flag, comments or nested sub-patterns. You can test a pattern interactively, and you know that line breaks and multiline matching behave differently across...
...explain what each run costs and on which servers it should run. You can test code that enqueues and performs jobs. You can compare GoodJob with the alternatives you will...
...queue: set up, configuration, the dashboard, how jobs are executed and retried ๐ Rails Guide: Testing jobs and the have_enqueued_job matcher โ how to test enqueuing and performing
...a short summary for your mentor. The questions at the end are not a test. If you can't answer one, that is exactly what your mentor wants to know...
...how Rails works out of the box: simple, robust, fast to build, easy to test with a real browser. The price is that every interaction is a full page load...
...validations and authorization, state management, more code, more build tooling, and a much harder testing story. Hybrids. The line isn't binary. A server-rendered app can embed an island...
...rather than per controller. You can attach records to the signed-in user and test the whole authentication flow. You can assess the security of an authentication implementation: brute force...
...should be customized to work with the existing form styles in your MovieDB. Add tests for all these features. Check your implementation Answer these questions about your MovieDB, and back...
You can build a ViewComponent following our conventions, and write a unit test for it. Resources Read what's new to you, skim what's familiar, skip what...
...be missing โ detect it and fall back โ in HTML, CSS and JavaScript. You can test an app in browsers and devices you don't own, e.g. on BrowserStack, including mobile...
...API, with a compatibility table at the bottom of each page ๐ MDN: Cross-browser testing โ the module, including feature detection in JavaScript and CSS ๐ Reminder: Safari is not an evergreen...
...screenshot: close enough to prove your HTML structure can carry the real layout. The test: pixel perfection must be reachable later mostly by editing CSS. Adding a layout container is...
Use vector graphics Create multiple sizes of the image Use media queries that test for min-device-pixel-ratio Use Use Ignore the issue Discuss the pros and cons...
...markup, update its spec. Keep these specs to the happy path: you'll unit-test the details of your components later, in Testing JavaScript with Jasmine. Refactor movie counter
...is typing in the search query. Search with the Movie.search scope you built in Testing basics. Note how this time, you have multiple elements that interact with each other:
...to memorize the key takeaways of 1-5 on the list. Watch Dominik's talk "Test-Led Development" (in our library) and try to apply his technique in the future
...Network tab, with throttling simulating a slow connection. You can create large amounts of test data quickly, e.g. inside a single transaction. Resources Read what's new to you, skim...
...yourself in Cucumber scenarios. Cucumber Factory We have a very useful gem to create test data in cucumber: cucumber_factory. Read through the README. Integrate it into your MovieDB and...
...you cannot find any opportunities to DRY up a Cucumber scenario, do this exercise (testing the file upload from before): Write a scenario: User can upload a movie poster in...
Best results in other decks
An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium WebDriver. This card shows basic techniques for fixing a flaky...
...and seed per process: DISPLAY=:17 bundle exec parallel_cucumber --serialize-stdout --verbose-process-command --test-options '--order random' features/ bin/cucumber --order random --profile parallel features/location/import.feature features/location/export.feature Using the parallel...
A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs, or only when the entire test suite is run.
...are many causes for flaky tests. This card focuses on a specific class of feature with heavy side effects, mostly on on the UI. Features like the following can amplify...