1,102 Matching Annotations
  1. Apr 2021
    1. let(:warden) do instance_double('Warden::Proxy').tap do |warden| allow(warden).to receive(:authenticate!).with(scope: :user) .and_return(authenticated?) allow(warden).to receive(:user).with(:user).and_return(user) end end let(:user) { instance_double(User) } let(:authenticated?) { true } def simulate_running_with_devise stub_const( 'Rack::MockRequest::DEFAULT_ENV', Rack::MockRequest::DEFAULT_ENV.merge('warden' => warden), ) end
  2. Mar 2021
    1. Prof. Devi Sridhar. (2020, March 25). We will be stuck in an endless cycle of lockdown/release for next 18 months, if we do not start mass testing, tracing, & isolating those who are carriers of the virus while pursuing rapid research for antiviral treatment or vaccine. This is the message the public needs to hear. [Tweet]. @devisridhar. https://twitter.com/devisridhar/status/1242743618986745861

    1. Why separate out red tests from green tests? Because my green tests serve a fundamentally different purpose. They are there to act as a living specification, validating that the behaviors work as expected. Regardless of whether they are implemented in a unit testing framework or an acceptance testing framework, they are in essence acceptance tests because they’re based upon validating behaviors or acceptance criteria rather than implementation details.
    2. Have you ever played the game 20 questions? Most of us have played that game at one point in our lives. One person thinks of something that could be an animal, vegetable, or mineral and then they answer yes/no questions that are asked of them. The point of the game is to ask as few questions as possible in order to accurately guess what the person is thinking.  This is how I think of the unit tests that I write the specified behavior as I’m doing test-first development. I ask what are the fewest tests that I need to write in order to assert the behavior I want to create.
    3. I am a big advocate of having a complete test base and even erring on the side of caution when it comes to quality engineering and software validation but that is not what we’re talking about here. What we’re talking about here are the tests that we write when we’re doing test-first development and I’m proposing that writing those tests from the perspective of specifying the behaviors that we want to create is a highly valuable way of writing tests because it drives us to think at the right level of abstraction for creating behavioral tests and that allow us the freedom to refactor our code without breaking it.
    1. Regression testing (rarely non-regression testing[1]) is re-running functional and non-functional tests to ensure that previously developed and tested software still performs after a change.[2] If not, that would be called a regression.
    1. In production, you will never trigger one specific callback or a particular validation, only. Your application will run all code required to create a Song object, for instance. In Trailblazer, this means running the Song::Create operation, and testing that very operation with all its side-effects.
    2. Run the complete unit with a certain input set, and test the side-effects. This differs to the Rails Way™ testing style, where smaller units of code, such as a specific validation or a callback, are tested in complete isolation. While that might look tempting and clean, it will create a test environment that is not identical to what happens in production.
  3. Feb 2021
    1. Miro Weinberger. (2020, December 3). Our 1st Covid-19 wastewater tests since Thanksgiving just came in—Virus levels are up significantly citywide. I hope that all of #BTV will look at this graph and see what I see: A call to action, to stop gathering with other households, and to get tested ASAP if you have https://t.co/8nxTwOOcFA [Tweet]. @MiroBTV. https://twitter.com/MiroBTV/status/1334613511692017664

    1. TRAILBLAZER-TEST The official stable release is only weeks away bringing you a bunch of new assertions that drastically reduce coding effort for tests! Of course, Minitest and RSpec will both be supported. TRAILBLAZER-STORY will follow as it turned out to be inevitable for setting up application state for tests. Instead of fumbling around with factories and traits in your tests, you “tell a story” about what to create in which order, easily customizable, and all written using activities. Currently, I’m working on designing the interfaces and it’s real fun!
  4. Jan 2021
    1. // Arrange const [refDiv, contentDiv] = getElements(); const [refAction, contentAction, getInstance] = createPopperActions({ placement: 'right-start', }); mountWithAction(refDiv, refAction); // Act mountWithAction(contentDiv, contentAction); // Assert expect(getInstance()).not.toBeNull();
  5. Dec 2020
    1. In a webinar hosted by MIT Sloan School of Management professor Andrew Lo on April 1, Bancel said that Moderna is already manufacturing mRNA for vaccines in its potential Phase II study, which could begin enrolling hundreds of people this spring, as well as its potential Phase III study, which could enroll thousands of people as early as late summer or early fall. In a US Securities and Exchange Commission filing the week before, Bancel also indicated that Moderna may request special permission to give people like doctors and nurses access to its vaccine this fall, before a formal approval. It’s an audacious plan for a company—and technology—that has yet to put a drug on the market.
  6. Nov 2020
  7. Oct 2020
    1. You want to write maintainable tests that give you high confidence that your components are working for your users. As a part of this goal, you want your tests to avoid including implementation details so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.

      key point. I think that this also means that NOT using data-testid is better since this is "testing library" specific attribute and 'binds' us to testin-library

    1. For any element that isn't there yet but will be there eventually, use findBy over getBy or queryBy. If you assert for a missing element, use queryBy. Otherwise default to getBy

      key point: summary of getBy, queryBy and findBy

    2. The neat thing about getByRole: it shows all the selectable roles if you provide a role that isn't available in the rendered component's HTML:

      pass no arguments and it will list all available roles in the element you passed to it (including implicit roles)

    3. Whereas the describe-block is the test suite, the test-block (which also can be named it instead of test) is the test case. A test suite can have multiple test cases and a test case doesn't have to be in a test suite. What you put into the test cases are called assertions (e.g. expect in Jest) which either turn out to be successful (green) or erroneous (red). Here we have two assertions which should turn out successful:

      Key point explaining key basic terms in React testign world

  8. Sep 2020
    1. Blokland, I. V. van, Lanting, P., Ori, A. P., Vonk, J. M., Warmerdam, R. C., Herkert, J. C., Boulogne, F., Claringbould, A., Lopera-Maya, E. A., Bartels, M., Hottenga, J.-J., Ganna, A., Karjalainen, J., Study, L. C.-19 cohort, Initiative, T. C.-19 H. G., Hayward, C., Fawns-Ritchie, C., Campbell, A., Porteous, D., … Franke, L. H. (2020). Using symptom-based case predictions to identify host genetic factors that contribute to COVID-19 susceptibility. MedRxiv, 2020.08.21.20177246. https://doi.org/10.1101/2020.08.21.20177246

  9. Aug 2020
    1. Vogels, C. B. F., Brackney, D., Wang, J., Kalinich, C. C., Ott, I., Kudo, E., Lu, P., Venkataraman, A., Tokuyama, M., Moore, A. J., Muenker, M. C., Casanovas-Massana, A., Fournier, J., Bermejo, S., Campbell, M., Datta, R., Nelson, A., Team, Y. I. R., Cruz, C. D., … Grubaugh, N. (2020). SalivaDirect: Simple and sensitive molecular diagnostic test for SARS-CoV-2 surveillance. MedRxiv, 2020.08.03.20167791. https://doi.org/10.1101/2020.08.03.20167791

    1. Hsieh, C.-L., Goldsmith, J. A., Schaub, J. M., DiVenere, A. M., Kuo, H.-C., Javanmardi, K., Le, K. C., Wrapp, D., Lee, A. G., Liu, Y., Chou, C.-W., Byrne, P. O., Hjorth, C. K., Johnson, N. V., Ludes-Meyers, J., Nguyen, A. W., Park, J., Wang, N., Amengor, D., … McLellan, J. S. (2020). Structure-based design of prefusion-stabilized SARS-CoV-2 spikes. Science. https://doi.org/10.1126/science.abd0826

  10. Jul 2020