0

Hi guys Ive been programing in nodejs for a couple of months now. But testing of the code is a daunting task. im looking for a better way to test my code.

My current setup:

  • server at digital ocean.
  • PuTTY for running the app.
  • Filezilla for uploading files to the server.
  • Notepad++

They way I test new code:

  • Close application at the server
  • Upload new data through filezilla
  • Reset server
  • load web page to see effects of new code.

Although I can do all of these steps pretty fast , I would interested in tips to speed testing up ?

I read about nodemon and I think it would reduce on of the steps (resetting the server) ?

Frederik

4
  • Test your code locally and with nodemon, only deploy it to your server (optimally, with your CI that does a pull from your source control). Commented Mar 25, 2018 at 11:38
  • Thanks for your reply , I'm sorry but what is CI ? Commented Mar 25, 2018 at 11:46
  • 1
    When you say testing, do you mean developing? If you don't have a local environment nothing you can try is going to be fast. Commented Mar 25, 2018 at 12:00
  • "When you say testing, do you mean developing?" - Yes that is what I mean. I never had nodejs instaled on my local machine but Ill try that :) thanks for your help Commented Mar 25, 2018 at 12:05

1 Answer 1

1

It is possible to run your application locally on your development machine, or another machine close to your development machine (e.g. a virtual machine (VM)). This will remove the need to transfer your application over the Internet each time you want to test. In order to do this, you just need to install NodeJS from the website or the package manager, and then you can run your application on your machine.

In addition, if your testing involves the repeated completion of certain steps after changes are made, then you might be interested in a testing framework such as Mocha, which will allow you to automate the testing process using more Javascript.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi thanks for your reply its much appreciated. I see both you and Benjamin Gruenbaum suggested testing the code locally is the way to go?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.