swsnu / swppfall2021

Learning Software Engineering By Building Web Services
28 stars 19 forks source link

[Homework3] Question about some specifications & testing #75

Open mieseung opened 2 years ago

mieseung commented 2 years ago

Hello, I have some questions about homework3 feature specification and testing.

  1. Is there any spec and testcase for wrong url or not given url in specifications, like ‘localhost:3000’, ‘localhost:3000/werfd’ and so on?

  2. In my case, npm --test --coverage does not work well. If i add the --watchAll=false, it works well. Will the test codes be graded with npm -- test --coverage --watchAll=false or just npm -- test --coverage?

  3. I found that store/action/index.js file stay 0% coverage even though there are no uncovered lines. Is it okay? I think #72 has the same problem!

  4. In Grading spec, does the unit test coverage mean the coverage for %Lines of all files? or is there any way to calculate this grading coverage?

Thanks in advance :)

kdh0102 commented 2 years ago

Thanks for your questions. The followings are the answers to each question:

  1. Please refer to question 3 in #63. If you are not logged in, the wrong URL should redirect you to the login page.
  2. We will grade your testing codes including the --watchAll=false option.
  3. index.js will not be included. Also, serviceWorker.js will not be included. You can ignore them by adding the following in your package.json.
    "jest": {
     collectCoverageFrom : [
       "src/**/*.{js,jsx}" ,
       "!src/index.js" ,
       "!src/serviceWorker.js",
       "!store/action/index.js"
    ] }
  4. The testing part will be graded based on the average of Statements and the avg of Branch.

Let me know if you have any further questions.

mieseung commented 2 years ago

I understood your answer about question 1, 2, and 4. But I have more questions about 3.

  1. I think that the ignored index.js is src/index.js. But the index.js which I mentioned is store/action/index.js. Should store/action/index.js also be ignored?

Thanks!

kdh0102 commented 2 years ago

@mieseung Please also ignore the store/action/index.js file. Sorry for the confusion.

mieseung commented 2 years ago

Thanks a lot! :)