First, if your project is not already setting a current Node version you will need to install at least Node 6:
nvm install 6
Next you can install Ionic with NPM:
npm install -g ionic@latest
You should now be able to use any
commands you need.
Any other dependencies for your project can be installed with NPM or Yarn.
There are a variety of different tools you might use to test your Ionic app. Ionic provides a detailed example that describes doing unit testing and end-to-end (e2e) testing with Karma and Jasmine.