Copilot Chat writes Unit Tests for you!

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2024

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

  • @Sa-So
    @Sa-So ปีที่แล้ว +3

    Great video ! I was thinking of making a similar video on copilot chat with tests & was looking for other people's take on this haha , I do have some unrelated questions if you would like to answer:
    How do you have autocomplete in terminal ?
    what is nr ? short for npm run ? (i am guessing you use ni)
    what is the -g flag ? (looks like it's used to run specific test but i have never used it)
    if you write 'as any' , how does ts accept it ? if the function accepts only number ? (so as means interpret it however you want just run it lol) if we say as string it infers it as string , if we say as any it removes types altogether ! wow ? and why doesn't undefined need it ?

    • @DevLeonardo
      @DevLeonardo  ปีที่แล้ว +1

      Thank you! Lot of questions, let me try to answer :)
      Autocomplete -> It's a tool called fig, I talk about it here: th-cam.com/video/HNVB9Dro2S4/w-d-xo.html
      nr -> yes, it's indeed ni, I also made a vide on that: th-cam.com/video/NiTmtiBgJKI/w-d-xo.html
      -g flag -> pattern to match only some tests
      as any -> Good question, I haven't tried but if you have some eslint flag set up it will at least complain about using any

  • @brunolopes9822
    @brunolopes9822 5 หลายเดือนก่อน

    Hey, I tried to use Github copilot to help to generate unit tests, and there are some problems.
    If i have files that are connected (model,service,controller,dto etc.), the copilot only reference 1 file(that are open) and not see the other files to make unit tests works.
    There are other options?
    Thanks!

  • @ShikharDadhich
    @ShikharDadhich ปีที่แล้ว +2

    Great video, however I felt like we do not have anything yet which can generate test cases considering all scenarios :(

    • @DevLeonardo
      @DevLeonardo  ปีที่แล้ว +1

      Thanks! :)
      It's an emerging technology so yeah, results are not yet at the level of copy pasting and just works... but they speed up the process a lot :D
      I haven't tried but after generating the first batch of test, you can still ask copilot chat to target specific edge cases 🤔
      Or actually, just keep writing the test cases manually and copilot helps filling them :D

  • @synapty
    @synapty 3 หลายเดือนก่อน +2

    Well, shouldn't it be exactly the other way around? Humans should write tests (first) that specify the expected software behavior and co-pilot (or whatever-AI) should then generate the code that fulfills the test.

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

    bar_is_green = code_is_correct XNOR test_is_correct

  • @sadokabdelbasset3226
    @sadokabdelbasset3226 ปีที่แล้ว +1

    give me the link of the extension please

    • @DevLeonardo
      @DevLeonardo  ปีที่แล้ว

      Hey, welcome to the channel!
      Sure, here's the extension link: marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat