anikethsaha / mern

:tada: This is boilerplate for MERN stack with integrations like Redux and SSR :tada:
https://mern.netlify.com
MIT License
99 stars 45 forks source link

Adding tests [ server tests ] for the project #21

Open anikethsaha opened 5 years ago

anikethsaha commented 5 years ago

The test library I am planning to use is jest. category of tests :

For now just two, please add more if works fine

Example of a test in chai

describe('/GET /', () => {
    it('it should GET all the books', (done) => {
      chai.request(server)
          .get('/')
          .end((err, res) => {
                res.should.have.status(200);
            done();
          });
    });
});

Thanks

anmol5varma commented 5 years ago

I can provide some help.

anikethsaha commented 5 years ago

@anmol5varma that's great. Ping me if you need any help from my side.

anmol5varma commented 5 years ago

@anikethsaha Do you have some folder structure in mind?

anikethsaha commented 5 years ago

folder structure for tests?

if so, then the current seems fine like a separate test folder at the root!

and if the about the project, then I guess I may have 2nd thoughts over the present one. Cause I have made a separate folder for the component which can be shared by both server and the client mainly had a better SSR solution in my mind. So would appreciate any suggestion over this.

anmol5varma commented 5 years ago

Generally while working we have component test inside them only. Hence I would advise if we have tests on the concerned files at the same level. I have written snapshot tests for the client folder with the same logic.

anikethsaha commented 5 years ago

Okay it's fine either way. You can go ahead with your tests. If possible try to make it at the root but tests are more important irrespective of where they are so gi ahead, add your tests. Looking forward for your PR

manas2297 commented 5 years ago

is it still open to work?

anikethsaha commented 5 years ago

Yeah.... It's open.... Feel free to reach out to me if you need any help

anikethsaha commented 5 years ago

@manas2297 are you planning to add tests for the server?

AlisherU commented 3 years ago

Hi @anikethsaha, do you still need help with this?

sheethalpatila commented 1 month ago

Hi @anikethsaha and team,

I’m [Sheethal Patil A], a [MERN fullstack developer] with experience in the MERN stack (MongoDB, Express, React, Node.js). I’ve been looking for opportunities to contribute to open-source projects, and I’m really impressed by the work you’re doing with this project.

I’d love to help with this issue [ Link ], as it seems to align well with my skills in [React and Node.js]. I’ve taken a look at the code and I’m ready to dive in. Is there anything specific you’d like me to focus on, or any additional context I should be aware of before getting started?

If there are other areas where you need help, please let me know! I’m eager to contribute and learn more.

Looking forward to your guidance!

Best regards, [Sheethal Patil A] [Profile]