1# Automated tests 2 3When working on a patch for DevTools, there's almost never a reason not to add a new test. If you are fixing a bug, you probably should write a new test to prevent this bug from occurring again. If you're implementing a new feature, you should write new tests to cover the aspects of this new feature. 4 5Ask yourself: 6* Are there enough tests for my patch? 7* Are they the right types of tests? 8 9We use three suites of tests: 10 11* [`xpcshell`](xpcshell.md): Unit-test style of tests. No browser window, only a JavaScript shell. Mostly testing APIs directly. 12* [Chrome mochitests](mochitest-chrome.md): Unit-test style of tests, but with a browser window. Mostly testing APIs that interact with the DOM. 13* [DevTools mochitests](mochitest-devtools.md): Integration style of tests. Fires up a whole browser window with every test and you can test clicking on buttons, etc. 14 15More information about the different types of tests can be found on the [automated testing page](https://developer.mozilla.org/en-US/docs/Mozilla/QA/Automated_testing) at MDN. 16 17To run all DevTools tests, regardless of suite type: 18 19```bash 20./mach test devtools/* 21``` 22 23Have a look at the child pages for more specific commands for running only a single suite or single test in a suite. 24