How This Test Saved Kent’s Site

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2024
  • Testing is a difficult and time consuming process, but it doesn’t have to be. If you take advantage of implicit testing you can get the same level of test quality and coverage while writing significantly less tests. This is exactly what Kent C. Dodds has done on his Epic Web site since he has just one test that gives him pretty good test coverage. In this video I will explain what implicit testing is and how you can take advantage of it.
    📚 Materials/References:
    Implicit Assertions Article: www.epicweb.dev/implicit-asse...
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    ⏱️ Timestamps:
    00:00 - Introduction
    01:18 - What Are Implicit Assertions
    04:10 - Why This Is Useful
    #WebDevelopment #WDS #Testing

ความคิดเห็น • 140

  • @kettanaito
    @kettanaito 29 วันที่ผ่านมา +170

    Thank you for bringing light to the topic of implicit testing! Feels surreal to have your writing showcased ❤

    • @WebDevSimplified
      @WebDevSimplified  28 วันที่ผ่านมา +12

      Thank you for writing this article. It was incredibly well written and all the examples you used were spot on. I will definitely be checking out more of your articles in the future.

    • @kettanaito
      @kettanaito 28 วันที่ผ่านมา +7

      @@WebDevSimplified Means a lot to me to hear that! Take a look at what I've already written, there's plenty of interesting testing topics we should be talking more about. Once again, huge thanks!

    • @Bhushantbn
      @Bhushantbn 26 วันที่ผ่านมา +2

      Thanks kyle for making videos on testing stuffs. Nowadays there is less talk about qa guys especially on youtube. Expect more stuff on testing..

  • @1DrowsyBoi
    @1DrowsyBoi 23 วันที่ผ่านมา +59

    Web devs really be out here writing "tests" that load an entire page and calling it a day, huh?

    • @tinahalder8416
      @tinahalder8416 7 วันที่ผ่านมา +1

      No one does this bs, no company will allow this nonsense

  • @sergtimosh
    @sergtimosh 28 วันที่ผ่านมา +116

    The problem with implicitly checking stuff- bad errors in the reports. You will not always get explicit errors, and will spend more time to investigate what went wrong. So basically it’s the matter of balance, I’d better use few more lines for things that I wan’t to be logged in the report for clarity.

    • @nielle1963
      @nielle1963 23 วันที่ผ่านมา +9

      It also implicitly assumes that you are the only one ever going to have to read and understand the test.

    • @piaIy
      @piaIy 23 วันที่ผ่านมา +5

      It's the opposite. From my experience, all of the popular testing libraries (Jest, Testing Library, Playwright, etc.) print very good error messages with diffs and lots of extra information when you use more complex assertions that include a bunch of implicit checking. The linked article has some good points about this. Think about `expect(obj.prop).toBe('something')` vs `expect(obj).toEqual({ prop: 'something' })`. If `obj` doesn't have a `prop` field, the former will give you something like "undefined is not equal to something", while the latter will print a diff between the two objects. And it's a very basic example, but it's even more true when you're asserting whole page elements with locators in e2e tests, because these complex assertions can handle edge cases you've never even thought of. Another example that most people without experience will write is a bunch of assertions with handwritten comparisons as the expect parameter coupled with `toBeTruthy`. These tests are almost useless if not outright evil because all you get is "false is not true" in case of an error, and you lose all the information about the context.

    • @-taz-
      @-taz- 23 วันที่ผ่านมา +1

      @@piaIy Yes, Jest et al. will say what went wrong, but not why it's wrong. Hopefully the developer of the test put the reasons for things into the test names, instead of just repeating the code in the strings.
      "people without experience will write is a bunch of assertions"
      In JS frameworks like Jest, yes. But in DocTest or Boost::Test for C/C++, or tons of other libraries (probably some in JS, too?), we can write assertions in the language directly and the framework is smart enough to produce nice output. If I could have the power of DocTest in JS, it would be a dream come true.

    • @paulstelian97
      @paulstelian97 18 วันที่ผ่านมา

      Implicit tests can be good if you run them every commit, because if a test suddenly fails it can be obvious that you have to look at the diff… most of the time.

  • @LoveLearnShareGrow
    @LoveLearnShareGrow 14 วันที่ผ่านมา +12

    The only problem with implicit tests is that when an error happens, it might be way harder to debug than if you had written more explicit tests that start very general and then narrow down to the details. That way you'll see how much went right before something went wrong, and you're more likely to get an error that is something like getting an orange when expecting an apple, as opposed to a confusing error where you expect an apple and get a "cannot call method on undefined".

  • @ispepsi2023
    @ispepsi2023 29 วันที่ผ่านมา +42

    This is the "testing" equivalent of "some things go without saying".
    Love it, awesome refresher!

  • @TennysonHull
    @TennysonHull 29 วันที่ผ่านมา +13

    This channel is a gold mine of information. Thank you for making making me a better engineer.

  • @sylvainschellenberger
    @sylvainschellenberger 28 วันที่ผ่านมา +13

    It seems you've mixed two different concepts in this video: while the blog post linked in the description talks about implicit assertions, the test of Kent C. Dodds' app is a smoke test. It doesn't really matter if the assertions are implicit or explicit, what matters is that this test runs in the CI pipeline, so it tests the status of the deployed app (any dev would be able to tell if the app is crashing in their own development environment).
    Besides, it is not even a reliable test for some classic webapp: the root url could render a blank page or the 'not found' page, and the test would still pass. It seems this app is some kind of learning material that users are expected to clone and run in their own local environment, so this smoke test is probably just testing that the tech stack can run in a basic node.js environment that is not Kent C. Dodds' personal computer.

  • @adaliszk
    @adaliszk 26 วันที่ผ่านมา +27

    Wouldn't be nicer to expect no exceptions to be thrown? That way at least the test itself hints at what we are looking for and not just relies on implicit assertions?

    • @nikkehtine
      @nikkehtine 23 วันที่ผ่านมา +1

      I guess the point here is primarily to just be a safe measure to protect you from shipping broken code, not a proper debug function. It's called "smoke test" after all. A smoke alarm doesn't tell you where the smoke is coming from, it's there primarily to warn you before it's too late.

    • @adaliszk
      @adaliszk 23 วันที่ผ่านมา +1

      ​@@nikkehtine Using that analogy, this way of writing the test sounds to me that the smoke detector checks the temperature of the air and not the CO2 concentration. While it does work, why not be more accurate with the intent?

    • @PunchingW00d
      @PunchingW00d 23 วันที่ผ่านมา +1

      Yeah, I've always seen tests like this assert no exceptions rather than asserting true -> true

  • @buddy.abc123
    @buddy.abc123 29 วันที่ผ่านมา +20

    I might start writing javascript tests now

    • @petleveler8366
      @petleveler8366 28 วันที่ผ่านมา +2

      me too.. as a fullstack dev that is 2 years in the Industry and now promoted to senior dev might as well write test lol

    • @wil-fri
      @wil-fri 25 วันที่ผ่านมา

      @@petleveler8366 test your validators

  • @den9943
    @den9943 29 วันที่ผ่านมา +88

    Don't you think that writing a test like this worsens the understanding of the intent of the person who is testing and merely leaves Easter eggs behind? If we try to implicitly cover all cases with one test and don't consider that the code being tested could change just enough to meet the test while not working correctly, then what's the point of writing tests at all?

    • @akam9919
      @akam9919 29 วันที่ผ่านมา +9

      For tests like these, don't be afraid to comment. Someone will know what the code does, but not know why it exists. Comments are your sometimes annoying and nerdy friend, but they clearly serve a critical role among your friend group. It's better to have them around than not.

    • @den9943
      @den9943 29 วันที่ผ่านมา +7

      @@akam9919 so let's comment everything instead of good test coverage, right? When we write comment, maybe our code is unclear and smells not so good. Better to write obvious code than support comments. Btw, comments keep silence when your code is broken down.

    • @TokyoXtreme
      @TokyoXtreme 29 วันที่ผ่านมา +4

      In my experience, we have tests that assert that the components rendered and are visible. In this case, we'd use end-to-end tests with an automated browser.

    • @den9943
      @den9943 29 วันที่ผ่านมา

      @@TokyoXtreme You can write tests however you like, depending on your intentions and what exactly you want to cover. The question was different-it was about the need to avoid writing overly detailed tests and to limit yourself to implicit, I would say magical, contrived ones more than they really are.

    • @TokyoXtreme
      @TokyoXtreme 29 วันที่ผ่านมา +2

      @@den9943 I think the test was that when the user navigates to the initial page, the page should appear? Unit tests can assert that a certain number of components or elements appear, although it may be easier to have E2E tests that assert nothing broke during an update. Full-page screenshots can assert that nothing visual changed within the layout.

  • @aamiramin6112
    @aamiramin6112 26 วันที่ผ่านมา

    Awesome. Thanks for sharing Kyle

  • @icedog225
    @icedog225 29 วันที่ผ่านมา +11

    I definitely see the benefit of having a basic smoke test. But about the point at 5:10 of removing redundant type assertions before testing - wouldn't leaving that explicit type assertion in there help make it clearer what exactly is expected (and what exactly went wrong) to whoever is reading the test?

    • @piaIy
      @piaIy 23 วันที่ผ่านมา

      How is an extra type assertion any clearer than just expecting the exact object? There's no additional benefit. The error message would contain the actual value of the data in case of a non-object type either way.

  • @arielcani85
    @arielcani85 24 วันที่ผ่านมา +2

    When you create a new Angular component, by default the cli creates a .spec.ts file with boilerplate config and a test asserting that the component should be truthy. I used to underestimate these tests when I start learning Angular, but they're critical in fact.

  • @BeCurieUs
    @BeCurieUs 29 วันที่ผ่านมา +5

    Every one of our base components has a unit test that basically just renders it as it. A great test to have.
    test('Some Component renders without crashing', () => {
    const div = document.createElement('div');
    ReactDOM.render(


    , div
    );
    ReactDOM.unmountComponentAtNode(div);
    });
    for basically every component

  • @mutatedllama
    @mutatedllama 23 วันที่ผ่านมา +6

    What's the purpose of hiding your true test in a riddle?
    Just write an explicit test.

  • @marna_li
    @marna_li 20 วันที่ผ่านมา +1

    This should actually be obvious. The reason why many don't want to write code is that they think of explicit testing - and sometimes coverage.
    Just having some code testing something is better than testing all the details. Unless perhaps you are dealing with a complex API consumed by others and you are dependant on the data returned.

  • @burtyful1
    @burtyful1 29 วันที่ผ่านมา +1

    Good stuff!

  • @QwDragon
    @QwDragon 28 วันที่ผ่านมา +2

    Does actually `goto` checks the page rendered without errors?
    Seems like it only throws if your server fails.

    • @adambickford8720
      @adambickford8720 28 วันที่ผ่านมา

      Throw an exception in your component. What happens to this test?

  • @nahueltarricone
    @nahueltarricone 27 วันที่ผ่านมา

    What about coverage if you are using a software like sonarcloud?

  • @GuRuGeorge03
    @GuRuGeorge03 22 วันที่ผ่านมา +1

    we have similar tests in our codebase and new developers keep asking why we have them or make PRs to delete these tests. When I tell them what kind of bugs they've already prevented from going live, they start understanding

  • @Vegamorphium
    @Vegamorphium 27 วันที่ผ่านมา +1

    Implicit testing has value of course, but the issue with things being implied is that different individuals expect different things. With fixed syntax code i appreciate that intention is clearer, but its a bad practice to get into. Tests are a safety net to move quickly and alert you of unexpected issues succinctly.

    • @piaIy
      @piaIy 23 วันที่ผ่านมา

      Read the article and the best practices chapters in the docs of the popular testing libraries; the overuse of explicit assertions is not only redundant, but sometimes even harmful, because they can obscure the intent and hide the context that a better, more complex assertion could convey in the error message.

  • @charleschukwuemeka8482
    @charleschukwuemeka8482 28 วันที่ผ่านมา +1

    Please, Can you do a tutorial on Backend Testing using TypeScript?

  • @randyproctor3923
    @randyproctor3923 22 วันที่ผ่านมา

    This reminds me of using assertions in C. They are kind of like sanity checks.

  • @prajunathunt
    @prajunathunt 29 วันที่ผ่านมา +2

    Simple but genius

  • @Nellak2011
    @Nellak2011 11 วันที่ผ่านมา

    So before watching the video, here is what I gather about that test.
    The await will only go through if the test runner is able to access the page. So that means that the expect true == true will only ever run if the await goes through.
    So I am assuming after a certain timeout, the test runner fails the async test.
    So this test is testing if it can access the page or not.

  • @libenhailu5193
    @libenhailu5193 28 วันที่ผ่านมา

    For smoke test it is great specially when features are added.

  • @dasten123
    @dasten123 29 วันที่ผ่านมา +2

    ok, performing the navigation makes sense, but what does expecting "true to be true" accomplish?

    • @lerarosalene
      @lerarosalene 26 วันที่ผ่านมา +1

      Many test frameworks complain about not having explicit assertions in them.

    • @Robert-yw5ms
      @Robert-yw5ms 26 วันที่ผ่านมา

      ​@lerarosalene which is a hint that either the testing library is defective or Kent is using it incorrectly. Either way he shouldn't be so proud of this test.

    • @piaIy
      @piaIy 23 วันที่ผ่านมา

      @@Robert-yw5ms Kent's answer to a similar complaint under his tweet: "This was written a long time ago before there really was anything on the page. I'm just saying that the difference between no tests and your first test is an enormous amount of confidence :)"

  • @sa3dclay859
    @sa3dclay859 29 วันที่ผ่านมา +20

    Senior (make it simpler)

    •  29 วันที่ผ่านมา +3

      Nah, we just lazy to actually check the rendered page. As long it render, then we push to prod.

    • @sa3dclay859
      @sa3dclay859 26 วันที่ผ่านมา

      Not exactly, I have seen it, some times developers write tests to check if the event is fired and how many times and with which attributes, etcetera,
      In my opinion, these extra checks are not useful and do not really serve the main idea of unit tests!

  • @doniaelfouly4142
    @doniaelfouly4142 22 วันที่ผ่านมา

    Thanks

  • @vlc-cosplayer
    @vlc-cosplayer 5 วันที่ผ่านมา

    My man took the advice of "Don't test the implementation details" a bit too far, and said "just do end to end testing lmao" 💀

  • @psychic8872
    @psychic8872 6 วันที่ผ่านมา

    What if there is no assertion at the end? Won't this still fail the test if there are problems?

  • @hundvd_7
    @hundvd_7 23 วันที่ผ่านมา +3

    I am sorry, I genuinely cannot watch this video. It's actually crazy how much you move your head around. It is _literally_ making me kinda dizzy. It's like you're trying to hypnotize me-and it's _working_

  • @kisaragi-hiu
    @kisaragi-hiu 23 วันที่ผ่านมา

    Something like this needs a comment to explain its purpose or even just to reassure the reader that yes, the writer knows what they're doing. This might be hard for a common pattern, but if it's the only test in a project a single comment would've reduced the confusion to zero.

  • @cameron1376
    @cameron1376 29 วันที่ผ่านมา

    Nifty stuff mate++ Thanks for this++

  • @nielsvanderveer
    @nielsvanderveer 24 วันที่ผ่านมา +1

    I do see the point you are making, but the example are a bit weird to be honest. Why do I want to test the amount of arguments of a self defined function? If it is randomly changed the tests of that sum function wouldn’t even run. Why do I even bother testing other function definition that are not part of my “unit”? I guess the important note is that this strategy applies to integration.
    Return types and arguments are classic examples a statically typed language does verify for you. I can’t imagine a word where I need to re-implement my code in a test to verify the call-signature is not messed up.

  • @idoschacham6276
    @idoschacham6276 20 วันที่ผ่านมา +1

    Sure, this test can catch rudimentary issues. However, if Kent's homepage loads an HTML page with no content and no errors then the test will pass, even though his website is broken.

  • @savageteam354k4
    @savageteam354k4 26 วันที่ผ่านมา

    hey men i really love the like your video it is deep and very helpful but right now i really struggle about file management like every time when i want to do some practice i always install react app again and again specially i am very confused by the installation of necessary files like nodemon , express and run my file on terminal and like so on things really hard for me so can you make a tutorial video on how to handle files and folders, do we have to install every time when we want run our app or so many things please?!

    • @alanonym8972
      @alanonym8972 23 วันที่ผ่านมา

      I am confused at how you are struggling with file management. If you want to practice, you should have a single project and push your knowledge to the limit on that single project. It is pointless to start a dozen project and never take it to the end, you will never learn the hard stuff by doing so.
      Any online tutorial "get started with react" would give you what you want in a few seconds, you do not need a video for that.

    • @zuka1100
      @zuka1100 11 วันที่ผ่านมา

      You don’t have to do npm install every time you start a project. What you can do is to make a template that you have already done npm install in and then copy and reuse it anytime you want to start a new project for practice. And when you think you want to start a new project with all the new features that you may not have in the previous version which is the template you created. Then you do another npm install

  • @nightshade427
    @nightshade427 29 วันที่ผ่านมา +1

    These are also known as indirect tests/scenarios, been around forever

  • @lbgstzockt8493
    @lbgstzockt8493 23 วันที่ผ่านมา

    I wonder how many of these tests are completely redundant in a statically typed and compiled language.

  • @ergeorgiev
    @ergeorgiev 23 วันที่ผ่านมา

    You implicitly have a test that tests all of those things, a dev refactoring the code doesn't know that so only focuses on the one explicit purpose of the test when rewriting it. So there's a downside to implicit testing.
    Also, integration tests.

  • @asagiai4965
    @asagiai4965 25 วันที่ผ่านมา

    Hot take
    I think there should be an easy way to implement tests in most ide
    Also, some predefined tests that are always in used must be included.

    • @piaIy
      @piaIy 23 วันที่ผ่านมา

      There is an easy way, it's called Copilot.

    • @asagiai4965
      @asagiai4965 23 วันที่ผ่านมา

      @@piaIy You can use copilot, but as of right now it doesn't give the same experience and functionality.

  • @XiaZ
    @XiaZ 28 วันที่ผ่านมา

    Isn't this already the norm, like, from the beginning of testing era?

  • @angell2341
    @angell2341 29 วันที่ผ่านมา

    You are amazing

  • @AlternativPerspectiv
    @AlternativPerspectiv 28 วันที่ผ่านมา

    We also expect that we are running javascript. 1 point.

  • @SlenderMiner99
    @SlenderMiner99 23 วันที่ผ่านมา +125

    Genuine feedback: I am not sure if the video needs your facecam to effectively get the point across and your shaking head while you're talking is strongly distracting me from the text content that I am trying to read. Perhaps consider omitting the facecam or at least reducing head movement.

    • @mrcheeseguyman
      @mrcheeseguyman 22 วันที่ผ่านมา +16

      lmao dude

    • @psybitcoin
      @psybitcoin 22 วันที่ผ่านมา +4

      Lol

    • @FlanderDev
      @FlanderDev 22 วันที่ผ่านมา +12

      Truth can hurt

    • @Levi_OP
      @Levi_OP 17 วันที่ผ่านมา +6

      If you want to read it why don’t you just go read the article on your own? Do you just want a voiceover you can read along to?

    • @ariassingh462
      @ariassingh462 16 วันที่ผ่านมา +6

      This makes no sense. Either cover that portion of the screen with your hand, or you know, read the actual article?

  • @RishiRajxtrim
    @RishiRajxtrim 29 วันที่ผ่านมา

    👍

  • @nanonkay5669
    @nanonkay5669 28 วันที่ผ่านมา

    Don't test functionality, test behavior

  • @zyt4zcn
    @zyt4zcn 29 วันที่ผ่านมา +9

    The test is fine, the assertion is idiotic

    • @TheStickofWar
      @TheStickofWar 29 วันที่ผ่านมา

      Agree

    • @-taz-
      @-taz- 29 วันที่ผ่านมา

      It seems like a failure would throw an exception which would fail the test? And the assertion would also pass so it's just a useless statement?

    • @mikemorrison5080
      @mikemorrison5080 28 วันที่ผ่านมา +1

      @@-taz- They could be using some linter which complains if you don't make an assertion.

  • @kitamashi
    @kitamashi 23 วันที่ผ่านมา +1

    bro talks by shaking his head

  • @Nellak2011
    @Nellak2011 11 วันที่ผ่านมา

    In real projects, NEVER use implicit tests. Implicit tests are non-intutive and as a result may be removed later by maintainers believing them to be trivial tests. Also, since they are implicit, it makes what they are testing unclear.
    Instead, you want Explicit tests that make it clear what the purpose is.
    You also want Property Based Tests rather than Example Based Tests, so that you don't forget edge cases.

  • @blueghost512
    @blueghost512 29 วันที่ผ่านมา +5

    If my NestJS builds successfully, it means it should work.
    No need for testing

  • @TheStickofWar
    @TheStickofWar 29 วันที่ผ่านมา

    Don’t be so amazed. You don’t need the assertion, the rest running and not crashing alone is enough for this type of test.
    It isn’t even worthy as a whole topic, if you’re not testing your component just renders then you’re doing something really wrong.

  • @AlternativPerspectiv
    @AlternativPerspectiv 28 วันที่ผ่านมา +1

    My guy, you are usually very good at diving into the subject matter but at 1:00 you are still just hyping up the video/subject! C'mon!

  • @waelltifi-2023
    @waelltifi-2023 28 วันที่ผ่านมา +1

    i don't care what anyone thinks , 99.9 % of unit tests in front end especially in that react sh!t IS AN ABSOLUTE WASTE OF TIME !!!

    • @Robert-yw5ms
      @Robert-yw5ms 26 วันที่ผ่านมา +1

      Pretty sure Kent already agrees with you.

    • @piaIy
      @piaIy 23 วันที่ผ่านมา +1

      Even the creators of RTL agree with you and recommend integration testing instead.

  • @waxfrenzy
    @waxfrenzy 14 วันที่ผ่านมา

    One (good) system test is worth a thousand unit tests

  • @diogenesoliveira6473
    @diogenesoliveira6473 29 วันที่ผ่านมา +7

    Honestly, it would be better to do expect().resolves or expect().not.toThrow. This expect(true).toEqual(true) just smells like someone trying to silence a linter

  • @jhirn2957
    @jhirn2957 22 วันที่ผ่านมา

    But it's not going to fail... because of the implication.

  • @mtranchi
    @mtranchi 17 วันที่ผ่านมา +1

    holy crap, something other than react. I unsubscribed a couple weeks ago because you seem to be solely focused on react these days...

  • @TheSliderW
    @TheSliderW 28 วันที่ผ่านมา

    I promise, you can write better explicit code and even have time for usefull comments when you don't waste time writing useless tests and test cases.

  • @AlternativPerspectiv
    @AlternativPerspectiv 28 วันที่ผ่านมา

    This is dumb. Sorry. This feels like the big deal made back when inline css became a thing, then a new movement against inline css came along with inline js then the next movement... each one was made to sound like THE way to do things.
    We are now at JSX and Typescript and next month something else will com along and be THE way to do things. Been there, dun that.

  • @GaryFerrao
    @GaryFerrao 24 วันที่ผ่านมา

    this is a good thing? lol
    i will check that the GET response code is valid. tell… me… your… intentions.

    • @GaryFerrao
      @GaryFerrao 24 วันที่ผ่านมา

      i get it that we need to make assumptions when testing. but it doesn’t mean you hide your intentions when programming.

  • @KentCDodds-vids
    @KentCDodds-vids 29 วันที่ผ่านมา +1

    Oh hi 👋

    • @WebDevSimplified
      @WebDevSimplified  29 วันที่ผ่านมา +1

      👋 I just want to say your testing content (including your testing JS course) is incredible. I have learned so much from it all.

    • @KentCDodds-vids
      @KentCDodds-vids 29 วันที่ผ่านมา +2

      @@WebDevSimplified thank you ☺️

  • @Dr-Zed
    @Dr-Zed 14 วันที่ผ่านมา

    I hate that assertion. Why does it exist? To make a shitty pinte rhaopy?

  • @tinahalder8416
    @tinahalder8416 7 วันที่ผ่านมา

    Wanna get fired as a Validation Engineer? Sureeeeeee

  • @aisdjsiasiodjisoajd7698
    @aisdjsiasiodjisoajd7698 29 วันที่ผ่านมา +1

    Kent C. Godds

  • @KaiHenningsen
    @KaiHenningsen 12 วันที่ผ่านมา +1

    Well, ackshually ...
    expect(true).toBe(true) also checks that your test suite is at least somewhat functional.

  • @fullfungo
    @fullfungo 24 วันที่ผ่านมา +3

    This is just a library abuse.
    If you are testing that “await xyz()” doesn’t throw errors, then WHY THE HELL would you write “expect(true).toBe(true)” instead of the obvious, and more sensible “await expect(xyz()).resolves.not.toThrow()”??
    The example you showed makes absolutely no sense. All it does is obfuscates the test, so that it becomes unintuitive for any future maintainer.

  • @tririfandani1876
    @tririfandani1876 29 วันที่ผ่านมา

    Please make more videos about epicweb / epicstack / remix