Skip to content

Commit

Permalink
Update testing instructions for developer and maintainer guides
Browse files Browse the repository at this point in the history
The updatetest and updatetestwin scripts have been added for developers
to update the expected output for all test sites.

Also, testing instructions for the developer and maintainer guides
assume that there is only one test site.

Let's update the developer and maintainer guides to include usage
instructions for the test site update scripts. Let's also generalize
the testing instructions for multiple test sites.
  • Loading branch information
Marvin Chin committed Apr 12, 2019
1 parent 45cc920 commit 9596ee0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
31 changes: 26 additions & 5 deletions docs/devGuide/devGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ A: If your npm version is v6.0.0 or higher, there is a change in behaviour on ho
Our test script does the following:

1. Lints the code for any code and style errors using ESLint.
1. Builds the test site found in `test/test_site/`.
1. Compares the HTML files generated with the HTML files in `test/test_site/expected/`.
1. Builds the test sites whose directory names are listed in `test/functional/test_sites`.
1. For each test site, compares the HTML files generated with the HTML files in its `expected` directory.

#### Running tests

Expand All @@ -136,20 +136,41 @@ $ npm run test
For Windows users:

```
$ npm run testwin
> npm run testwin
```

#### Updating tests

When adding new features, updating existing features or fixing bugs, you should update the expected site to reflect the changes.

You may use the following script to update the expected sites:

For Unix:

```
$ npm run updatetest
```

For Windows users:

```
> npm run updatetestwin
```
<box type="warning">
You should always check that the output generated is correct before committing your changes to the expected site.
</box>

##### Changes to existing features

Simply update the expected HTML files in `test/test_site/expected/` to reflect the changes.
Simply update the expected HTML files for each test site to reflect the changes.

##### New features

Add new site content into the `test/test_site/` folder to demonstrate the new feature. Ensure that the new content is included in the test site so that your feature will be tested when `markbind build` is run on the test site. Remember to update the expected HTML files in `test/test_site/expected/`.
Add new site content into an existing test site or create a new test site to demonstrate the new feature. Ensure that the new content is included in the test site so that your feature will be tested when `markbind build` is run on the test site. Remember to update the expected HTML files for the test site.

<box type="info">
When creating a new test site, the directory name of the new test site should be added to <code>test/functional/test_sites</code>.
</box>

### Using ESLint

Expand Down
10 changes: 4 additions & 6 deletions docs/devGuide/maintainerGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ $ git commit -m 'Update vue-strap version to v2.0.1-markbind.XYZ'
2. Rebuild the test files.

```
$ cd test/functional/
# on Unix
$ npm run updatetest
# for each test site
$ cd <TEST_SITE_NAME>
$ markbind build
$ cp _site/* expected/
$ cd ..
# on Windows
> npm run updatetestwin
```

When rebuilding the expected test files, ensure that **only** the version number is updated. For example, this is correct:
Expand Down

0 comments on commit 9596ee0

Please sign in to comment.