Usage

Information regarding daily usage and typical services that will be used during development of the Phoenix platform.

Testing

PHPUnit

To run PHP tests locally, ssh into the Homestead Vagrant box, cd into the Phoenix repository location and use PHPUnit, by running:

$ phpunit

It is recommended that you run PHP Unit tests within the Homestead Vagrant box.

Jest

To run JavaScript Jest tests locally, run:

$ npm test

Cypress

To run JavaScript Cypress tests locally, run:

$ npm run cypress

New GraphQL types, fields, queries, and mutations should be reflected in the root schema.json file that is used by our Cypress test suite to mock GraphQL requests. The easiest way to update the schema is by using the schema:fetch command:

$ npm run schema:fetch

Code Style

We use Prettier to format our code & ESLint to catch common mistakes.

They run in the following scenarios:

  • When using the npm start command, your files will be "watched" for changes, and when a change is detected, the JS code will be linted and only compiled if it passes.

  • Code will be automatically formatted when committing changes. You can also install an editor plugin to reformat code as you write it, or manually format the project with npm run format.

  • You can manually lint code by running npm run lint -s. The -s option lets you suppress the verbose NPM warnings that follows when there are linting errors.

  • Code linting also runs via Wercker, our continuous integration service, when a new pull request is made for the repository.

We use StyleCI service to lint our PHP code when a new pull request is made for the respository.

Helper Methods

See here for some information on developing with our suite of helper methods.

Services

There are a couple of other third-party services that you will want access to for development:

Review Apps

When a pull request is submitted to the Phoenix repository, a temporary deploy is made from the feature branch to Heroku for reviewers to experience new changes to the site in a sample environment. Read more about this in the Heroku documentation for Review Apps.

Dev & QA Environments

Once a Pull Request is merged, a deploy to our Development and QA (staging) environment is automatically triggered on the Phoenix Pipeline in Heroku.

The Development environment can be accessed at https://dev.dosomething.org.

The QA environment can be accessed at https://qa.dosomething.org.

Last updated