Jetpack/Testing: Difference between revisions

Jump to navigation Jump to search
Line 23: Line 23:
So if you navigate to a package's root directory (containing a package.json file) and execute <code>cfx test</code>, <code>cfx</code> will:
So if you navigate to a package's root directory (containing a package.json file) and execute <code>cfx test</code>, <code>cfx</code> will:


# initialize the tests directory using the "tests" value inside "package.json", or the top-level "tests/" or "test" directory
# initialize the tests directory using the "tests" value inside "package.json", or the top-level "tests/" or "test/" directory
# load every module it finds in the tests directory which starts with "test"
# load every module it finds in the tests directory which starts with "test"
# call each function exported by that module, passing it a [https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/api-utils/docs/unit-test.html test] object as an argument.
# call each function exported by that module, passing it a [https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/api-utils/docs/unit-test.html test] object as an argument.
canmove, Confirmed users
737

edits

Navigation menu