fix(docs) Corrected challenge template example (#35307)

This commit is contained in:
Randell Dawson
2019-02-26 11:21:00 -08:00
committed by Valeriy
parent 67d1a633cf
commit 5aab82cc89

View File

@ -12,14 +12,22 @@ You can also clone the project and edit locally on your computer. For help with
### Challenge Template ### Challenge Template
Here is a template of what the challenge markdown files look like. Below is a template of what the challenge markdown files look like.
**Notes:**
1. In the below sections, examples of `{ext}` are:
* `html` - HTML/CSS
* `js` - JavaScript
* `jsx` - JSX
2. For the `Tests` section below, `text` and `testString` should be valid YAML strings. `testString` can be a stringified function or expression possibly using Chai asserts.
````md ````md
--- ---
id: Unique identifier (alphanumerical, MongoDB_id) id: Unique identifier (alphanumerical, MongoDB_id)
title: Challenge Title title: Challenge Title
challengeType: 0 challengeType: 0
guideUrl: 'url of guide article'
videoUrl: 'url of video explanation' videoUrl: 'url of video explanation'
--- ---
@ -32,40 +40,45 @@ A Description of the challenge and what is required to pass
<section id='instructions'> <section id='instructions'>
Instructions about what exactly needs to be done. Instructions about what exactly needs to be done.
</section> </section>
## Tests ## Tests
<section id='tests'> <section id='tests'>
``` yml ``` yml
- text: Should return "foo". tests:
testString: 'A stringified function using Chai asserts' - text: Should return "foo"
testString: 'A stringified function possibly using Chai asserts'
``` ```
</section> </section>
<div id='js-seed'> ## Challenge Seed
<section id='challengeSeed'>
```js <div id='{ext}-seed'>
```{ext}
Code displayed in the editor by default. Code displayed in the editor by default.
This is a required section for the challenge.
``` ```
</div> </div>
### Before Test ### Before Test
<div id='js-setup'> <div id='{ext}-setup'>
```js ```{ext}
Test setup code. Optional Test setup code.
``` ```
</div> </div>
</section>
### After Test ### After Test
<div id='js-teardown'> <div id='{ext}-teardown'>
```js ```{ext}
Test tear down code. Optional Test tear down code.
``` ```
</div> </div>
@ -75,8 +88,8 @@ Test tear down code.
## Solution ## Solution
<section id='solution'> <section id='solution'>
```js ```{ext}
Challenge solution code. // solution required
``` ```
</section> </section>