Skip to content

Commit 13ac3f3

Browse files
authored
Merge pull request ironhack-labs#2870 from ironhack-labs/uros/update/update-testing-instructions
Update the instructions for running the tests.
2 parents bbd5108 + 7f23dcc commit 13ac3f3

File tree

3 files changed

+71
-73
lines changed

3 files changed

+71
-73
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 59 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,83 +11,46 @@ Manipulating arrays in code is a very common operation. Whether you are creating
1111
## Requirements
1212

1313
- Fork this repo
14+
1415
- Clone it to your machine
15-
- Visit the "actions" tab in your fork, and enable workflows.
16+
17+
1618

1719
## Submission
1820

19-
Upon completion, run the following commands:
21+
- Upon completion, run the following commands:
2022

2123
```bash
2224
git add .
2325
git commit -m "Solved lab"
2426
git push origin master
2527
```
2628

27-
Create Pull Request so your TAs can check up your work.
28-
29-
<br>
30-
31-
## Automated Testing Introduction
32-
33-
<br>
34-
35-
### What is automated testing?
36-
37-
Automated software testing is the process of programmatically executing an application in order to validate and verify that it meets the business needs, as well as the technical requirements, and that it behaves as expected.
38-
39-
Testing should be viewed as a continuous process, not a discrete operation or single activity in the development lifecycle. Designing tests at the beginning of the product lifecycle can be help to mitigate common issues that arise when developing complex code bases.
40-
41-
Having strong _test suites_ can provide you ease of mind, since you will be able to confidently improve upon your work while knowing that your not breaking a previously developed feature.
42-
43-
<br>
44-
45-
### Testing labs
46-
47-
This lab, along with some of the labs you will be working on during the bootcamp, has a complete test suite that is meant to ensure that your work fulfills the requirements we established.
29+
- Create a Pull Request so that your TAs can check your work.
4830

4931
<br>
5032

51-
### Testing with Jest
52-
53-
Jest is an automated test-runner for JavaScript.
54-
55-
Before start coding, we will explain the project structure we have provided you.
5633

57-
We will be working with the `src/functions-and-arrays.js` file.
58-
The process you will be following step by step in this lab stays the same for all the following labs. It will take you a bit to actually become comfortable with it, but don't worry, it is completely okay to get stuck! We are here to help. 🤝
5934

60-
Let's go!
61-
62-
To run your tests, open your terminal at the root directory of the lab, run `npm install` to install your dependencies and `npm run test:watch` to run the tests and generate the `lab-solution.html` file.
63-
64-
```shell
65-
$ cd lab-javascript-functions-and-arrays
66-
$ npm install
67-
$ npm run test:watch
68-
```
35+
## Instructions
6936

70-
<br>
37+
You will work on the `src/functions-and-arrays.js` file, which is already loaded in the `index.html` file.
7138

72-
In case you want to check the tests, they are in the `tests/functions-and-arrays.spec.js` file.
39+
To run the JavaScript code open the `index.html` file use the [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) VSCode extension.
7340

74-
Open the `lab-solution.html` file using the [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) VSCode extension.
41+
To see output of your JavaScript code open the [Console in the Developer Tools](https://developer.chrome.com/docs/devtools/open/#console).
7542

76-
<br>
43+
While following the instructions for each iteration, make sure to carefully read the instructions to fully understand the task requirements. Do not rush. You should take your time to carefully read every iteration.
7744

78-
#### Pass the tests
7945

80-
You should work on the `src/functions-and-arrays.js` file. While following the instructions for each iteration, you should check every test and make sure it's _passing_, before moving on.
8146

82-
Do not rush. You should take your time to carefully read every iteration, and you should address the _breaking_ tests as you progress through the exercise.
47+
### Note about tests
8348

84-
When coding with tests, it is super important that you carefully read and understand the errors you are getting, this way you will know for sure what's expected from your code.
49+
This LAB, along with some of the labs you will be working on during the bootcamp, is equipped with unit tests to provide automated feedback on your lab progress.
8550

86-
Note that **you don't need to execute the functions yourself**, the tests are responsible for doing that. All you should do is declare them, make sure they deal with the parameters passed and that they return what is indicated on the iterations and in the test messages. For some iterations we provide you with a sample array, so that you can do some **manual** testing, if you wish.
51+
**After you’ve completed the basic iterations**, go to the **"Test Your Code"** section at the bottom. There you'll be asked to install the testing dependencies and run the tests to check how many tests your code is passing.
8752

88-
<br>
8953

90-
## Instructions
9154

9255
<br>
9356

@@ -305,4 +268,50 @@ Following the logic you've used in iteration #8, declare a function called `grea
305268

306269
<br>
307270

271+
272+
273+
## Test Your Code
274+
275+
<br>
276+
277+
### Automated Testing
278+
279+
Automated software testing is the process of automatically testing an application in order to verify that it meets the technical requirements, and that it behaves as expected.
280+
281+
Having strong _test suites_ can provide you ease of mind, since you will be able to confidently improve upon your work while knowing that your not breaking a previously developed feature.
282+
283+
284+
285+
<br>
286+
287+
### Testing with Jest
288+
289+
Jest is an automated test-runner for JavaScript.
290+
291+
To run your tests, open your terminal at the root directory of the lab, run `npm install` to install your dependencies and `npm run test:watch` to run the tests and generate the `lab-solution.html` file.
292+
293+
```shell
294+
$ cd lab-javascript-functions-and-arrays
295+
$ npm install
296+
$ npm run test:watch
297+
```
298+
299+
<br>
300+
301+
In case you want to check the tests, they are in the `tests/functions-and-arrays.spec.js` file.
302+
303+
Open the `lab-solution.html` file using the [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) VSCode extension.
304+
305+
<br>
306+
307+
#### Pass the tests
308+
309+
When coding with tests, it is super important that you carefully read and understand the errors you are getting, this way you will know for sure what's expected from your code.
310+
311+
Note that **you don't need to execute the functions yourself**, the tests are responsible for doing that. All you should do is declare them, make sure they deal with the parameters passed and that they return what is indicated on the iterations and in the test messages. For some iterations we provide you with a sample array, so that you can do some **manual** testing, if you wish.
312+
313+
<br>
314+
315+
##
316+
308317
**Happy coding!** :heart:

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>LAB | JS Functions & Arrays</title>
8+
</head>
9+
<body>
10+
<script src="./src/functions-and-arrays.js"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)