Skip to content

Commit

Permalink
Merge pull request #8428 from cfpb/ans_update_docs
Browse files Browse the repository at this point in the history
Some doc updates
  • Loading branch information
willbarton authored May 20, 2024
2 parents 8855e0e + ae3167a commit 2bfa7a6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 35 deletions.
19 changes: 7 additions & 12 deletions docs/contributing-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,7 @@ nav:

## Running the docs locally

With a
[stand-alone Python virtualenv for consumerfinance.gov](installation.md#set-up-a-local-python-environment-optional):

```bash
pyenv activate consumerfinance.gov
pip install -r requirements/docs.txt
mkdocs serve -a :8888
```

Once running, they are accessible at http://localhost:8888.
See [Running documentation site locally](running-docs.md).

## Deploying the docs to GitHub Pages

Expand All @@ -79,8 +70,12 @@ for more information.

Some internal documentation is not suitable for inclusion in the public docs.

Internal documentation can be linked from publicly-viewable documentation only
if internal domain names and URLs are not shared publicly. To support such linking,
!!! warning

Internal documentation can be linked from publicly-viewable documentation only
if internal domain names and URLs are not shared publicly.

To support such linking,
the consumerfinance.gov Wagtail admin has a custom "Internal documentation" setting
that allows for dynamic linking to an internal URL without exposing that URL in
public source code or documentation.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Using the console, navigate to the root directory in which your projects
live and clone this project's repository:

```sh
git clone git@github.com:cfpb/consumerfinance.gov.git
git clone https://github.com/cfpb/consumerfinance.gov.git
cd consumerfinance.gov
```

Expand Down
38 changes: 16 additions & 22 deletions docs/javascript-unit-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,34 @@ it would be a good idea to peruse their docs before diving in here.

## Running unit tests

### Run a single test file

To run a single test file, pass the name (or path) of the spec:
To run all of the unit tests:

```bash
yarn jest Notification-spec.js
# Equivalent to:
yarn jest test/unit_tests/js/molecules/Notification-spec.js
# The name argument would technically would match all Notification-spec.js files
# This usually isn't a problem in our codebase (and you can always get more specific if needed)
yarn jest
```

### Run a directory of unit tests

A directory of unit tests can be run by passing its name or path:
To first lint all files and then run tests:

```bash
yarn jest organisms
yarn jest test/unit_tests/js/organisms
yarn test
```

### Run all unit tests
!!! note

To run all of the unit tests:
To run a single test, or a directory of tests, you can run, for example:

```bash
yarn jest
```
```bash
# Single test file:
yarn jest Notification-spec.js
# Equivalent to:
yarn jest test/unit_tests/js/molecules/Notification-spec.js

To first lint all files and then run tests:
# Directory:
yarn jest organisms
# Equivalent to:
yarn jest test/unit_tests/js/organisms

```bash
yarn test
```
```

Because we invoke jest directly, you can pass any command-line args it accepts
to filter your output or to target specific tests [see the docs for more](https://jestjs.io/docs/cli).
Expand Down

0 comments on commit 2bfa7a6

Please sign in to comment.