} } } }) }) Usage expect(actualValue).toBeAnything(...matcherArguments) When a matcher is invoked, Jasmine will call its compare() function with the actualValue, followed by any arguments passed to the matcher. It...
Stacktrace frame [n] -- Moves to a frame in the n-th call stack You can use where to find out the numbers finish [n] -- Runs the program...
...seconds to 168 milliseconds. Maybe it's a good time to stop and call it a day. If the JSON you are trying to build is fairly simple, you could...
...that it already owns? By writing it to the disk (or into a so called "materialized view"). First, tell PostgreSQL with a migration what the contents of this view should...
...app that manages a list of movies and a list of actors. We will call this app "MovieDB" in subsequent cards. Skim the README file of the project if you...
...To stabilize asynchronous work of Turbo, we have to find good events to wrap calls to startWork and stopWork around them. The framework currently does not define symmetric events for...
...not currently offer perfectly symmetrical event pairs. // We must ensure that stopWork is not called more often than startWork this.lockCounter-- window.CapybaraLockstep?.stopWork(event.type) } } } const application = Application.start() application.register("capybara-lockstep", CapybaraLockstepController...
...If you did this you will need to find the original branch point and call git rebase with a SHA1 revision. Your editor will open with a file like
module WebpackerCompileOnce COMPILE_WAIT_TIMEOUT = 180 COMPILE_WAIT_POLL_INTERVAL = 0.3 def compile # Calling #compile will at least once compute SHAs over the content # of all files in app...
...parallel_tests process has finished compiling. def wait_until_fresh # We're going to call #fresh? a lot. This will call #watched_files_digest, which # computes SHAs over the contents...
...span&t;bar</span>' Bad The solution is not to call html_safe on the joined array and if you thought it would be, you don't understand...
...how XSS protection works in Rails. Calling html_safe on the joined array will incorrectly bless the complete string as safe: [safe_string, unsafe_string].join(' ').html_safe # will incorrectly...
If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more like === instead of ==). For example: expect(subject).to receive(:foo...
...new node feature that automatically installs yarn (and pnpm) for you when it is called. It allows you to specify a desired yarn version inside package.json and makes sure the...
...Node.js starting from 14.19.0 and 16.9.0 but is disabled by default. To enable it, call: corepack enable The yarn command will be available afterwards. Note To start a new project...
...handled before e.g. a page.refresh statement returns. That that this also applies to wrapped calls like accept_confirm { page.refresh }. Recommendation We do not recommend BiDi mode as a default because...
...code base. It should be encapsulated in single files or folders. Be easy to call: A service should always try to have a simple public interface, even if that causes...
...constants, constantize and safe_constantize. Neither is safe for untrusted user input. Before you call either method you must validate the input string against an allowlist. The only difference between...
prettier calls itself an opinionated code formatter. I recommend using it for your JavaScript and TypeScript code. prettier only concerns itself with the formatting of your JavaScript (and also some...
...Write tests for both exercises. Write multiple variants, each using a different approach: Just call the real API from the example (skip this variant for the "upcoming movie" exercise)
...updates your $PATH when the prompt is being displayed). For these commands you can call mise explicitly in your shell config: eval "$(mise exec starship -- starship init zsh)"
...mise/asdf plugin and the second one is the name of the plugin we're calling. Install tools mise will re-use .tool-versions files in your home directory or in...
...routes, so we can write it as follows. class RackLoggerWithSilencedActiveStorageRoutes < Rails::Rack::Logger def call(env) if env['PATH_INFO']&.start_with?("#{Rails.configuration.active_storage.routes_prefix}/") Rails.logger.silence do super end else
...element or set scrollTop on both and . Finding the scrolling element Your JavaScript can call document.scrollingElement to retrieve the scrollable element for the main viewport. On Chrome, Firefox and modern...
...street # => "Foo Avenue 77" Hint You can convert any object to a string by calling #to_s on it. The matching should be case-insensitive. Also when the query string...
...random_each. The method should iterate through the array elements in random order and call the given block for each iteration. For example, the following should work...
...you to use Capybara Finders methods (e.g. #find) on the doc element and then call matchers on that element: link_element = doc.find('a') expect(link_element).to have_selector('.nav...
...by default, such that rendered is converted once one of Capybara's matchers is called on it, it's default type is still a String. (As noted in the Capybara...
...updated_at_of_expensive_scope') fresh_when last_modified: updated_at The example above calls fresh_when without an object, so Rails will only set the Last-Modified header and...
...das SNS Topic Benachrichtigungen von AWS Config entgegen nehmen. Anschließend soll diese per API-Call ein Issue in deinem Gitlab Projekt erstellen. Versuche so früh wie möglich deine Lambda via...
...cleared automatically after each test. By including the following helper hooks your tests can call jasmine.fixtures to access a container that is emptied once the test concludes: beforeAll(function() { jasmine.fixtures...
...to load records and their associations in a fixed number of queries. This is called preloading or eager loading associations. By preloading associations you can prevent the n+1 query...
...order => 'created_at DESC', :include => :author) end end This controller action works until someone calls the action with a category containing a dot character. This will make ActiveRecord join the...