freeCodeCamp/seed/challenges/automated-testing-and-debug...

56 lines
2.4 KiB
JSON
Raw Normal View History

2015-08-05 18:57:58 +00:00
{
2015-08-15 20:57:44 +00:00
"name": "Automated Testing and Debugging",
"order": 14,
"time": "15m",
2015-08-05 18:57:58 +00:00
"challenges": [
{
"id":"cf1111c1c16feddfaeb6bdef",
2015-08-15 20:57:44 +00:00
"title":"Use the Javascript Console",
"difficulty":0,
"description":[
2015-08-15 20:57:44 +00:00
"Both Chrome and Firefox have excellent JavaScript consoles, also known as DevTools, for debugging your JavaScript.",
"You can find <code>Developer tools</code> in your Chrome's menu or <code>Web Console</code> in FireFox's menu. If you're using a different browser, or a mobile phone, we strongly recommend switching to desktop Firefox or Chrome.",
"Let's print to this console using the <code>console.log</code> method.",
"<code>console.log('Hello world!')</code>"
],
"tests":[
"assert(editor.getValue().match(/console\\.log\\(/gi), 'message: You should use the console.log method to log \"Hello world!\" to your JavaScript console.');"
],
"challengeSeed":[
2015-08-15 20:57:44 +00:00
"",
"",
""
],
2015-08-19 04:49:16 +00:00
"challengeType":1,
"type": "waypoint"
},
{
"id":"cf1111c1c16feddfaeb7bdef",
"title":"Using typeof",
"difficulty":0,
"description":[
2015-09-04 22:22:45 +00:00
"You can use <code>typeof</code> to check the <code>data structure</code>, or type, of a variable.",
"Note that in JavaScript, arrays are technically a type of object.",
"Try using <code>typeof</code> on each of the following to see which types they have.",
2015-08-15 20:57:44 +00:00
"<code>console.log(typeof(\"\"));</code>",
"<code>console.log(typeof(0));</code>",
"<code>console.log(typeof([]));</code>",
"<code>console.log(typeof({}));</code>"
],
"tests":[
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\"\"\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> a string.');",
"assert(editor.getValue().match(/console\\.log\\(typeof\\(0\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> a number.');",
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\[\\]\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> an array.');",
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\{\\}\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> a object.');"
],
"challengeSeed":[
2015-08-15 20:57:44 +00:00
"",
"",
""
],
2015-08-19 04:49:16 +00:00
"challengeType":1,
"type": "waypoint"
}
2015-08-05 18:57:58 +00:00
]
}