Skip to content

Commit 2b10c30

Browse files
committed
Remove clutter, refactor instructions
1 parent 5f42b41 commit 2b10c30

File tree

7 files changed

+199
-372
lines changed

7 files changed

+199
-372
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ jobs:
99
- name: Prepare environment
1010
uses: actions/setup-node@v2
1111
with:
12-
node-version: "15"
12+
node-version: '14'
1313
check-latest: true
14-
- name: Install modules
14+
- name: Install dependencies
1515
run: npm i
1616
- name: Run tests
1717
run: npm run test -- --ci --reporters=default --reporters=jest-junit
1818
- name: Reports the results of tests
1919
uses: IgnusG/jest-report-action@v2.3.3
20-
if: always() # Or use "continue-on-error: true" in previous test step
20+
if: always()
2121
with:
2222
access-token: ${{ secrets.GITHUB_TOKEN }}
2323
run-name: test

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
.DS_Store
21
node_modules
2+
.DS_Store
3+
.vscode
34
package-lock.json
4-
junit.xml
5+
yarn.lock
6+
*.log
7+
lab-solution.html

.prettierrc

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

README.md

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Manipulating arrays in code is a very common operation. Whether you are creating
1515

1616
Upon completion, run the following commands:
1717

18-
```
19-
$ git add .
20-
$ git commit -m "done"
21-
$ git push origin master
18+
```bash
19+
git add .
20+
git commit -m "done"
21+
git push origin master
2222
```
2323

2424
Create Pull Request so your TAs can check up your work.
@@ -31,47 +31,35 @@ Automated software testing is the process of programmatically executing an appli
3131

3232
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.
3333

34-
Having a strong _test suite_ 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.
34+
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.
3535

3636
### Testing labs
3737

3838
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.
3939

40-
### Testing with Jasmine
41-
42-
<!-- ![Jasmine Logo](https://i.imgur.com/A1pop7h.png) -->
43-
44-
Jasmine is an automated testing framework for JavaScript. It is designed to be used in Behavior-driven Development (**BDD**) programming, which focuses more on the business value than on the technical details.
40+
### Testing with Jest
4541

46-
We have already included Jasmine in the project you just forked, so let's see how to use it to implement our code.
47-
48-
### Usage
42+
Jest is an automated test-runner for JavaScript.
4943

5044
Before start coding, we will explain the project structure we have provided you:
5145

5246
```
5347
lab-js-functions-and-arrays
5448
├── README.md
5549
├── SpecRunner.html
56-
├── jasmine
57-
│   └── ...
5850
├── src
5951
│   └── functions-and-arrays.js
6052
└── tests
6153
└── functions-and-arrays.spec.js
6254
```
6355

64-
We will be working with the `src/functions-and-arrays.js`. In the `jasmine` folder you can find all of the files needed to use Jasmine. All these files are already linked with the `SpecRunner.html` file. In case you want to check the tests, they are in the `tests/functions-and-arrays.spec.js` file.
65-
66-
#### Run tests
67-
68-
Running automated tests with Jasmine is super easy. All you need to do is open the `SpecRunner.html` file in your browser. You will find something similar this:
56+
We will be working with the `src/functions-and-arrays.js` file. 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 generate the `lab-solution.html` file. In case you want to check the tests, they are in the `tests/functions-and-arrays.spec.js` file.
6957

70-
![image](https://user-images.githubusercontent.com/23629340/33389609-c2f3965c-d533-11e7-9a03-e0a89314dd98.png)
58+
Open the `lab-solution.html` file using the live server VSCode extension.
7159

7260
#### Pass the tests
7361

74-
You should write your code 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.
62+
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.
7563

7664
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.
7765

package.json

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
{
22
"name": "lab-javascript-functions-and-arrays",
33
"version": "1.0.0",
4-
"description": "![logo_ironhack_blue 7](https://user-images.githubusercontent.com/23629340/40541063-a07a0a8a-601a-11e8-91b5-2f13e4e6b441.png)",
5-
"main": "index.js",
6-
"type": "module",
7-
"directories": {
8-
"test": "tests"
9-
},
4+
"license": "UNLICENSED",
105
"scripts": {
11-
"test": "node --experimental-vm-modules node_modules/.bin/jest"
12-
},
13-
"repository": {
14-
"type": "git",
15-
"url": "git+https://github.com/josecarneiro/lab-javascript-functions-and-arrays.git"
16-
},
17-
"keywords": [],
18-
"author": "",
19-
"license": "MIT",
20-
"bugs": {
21-
"url": "https://github.com/josecarneiro/lab-javascript-functions-and-arrays/issues"
6+
"test": "jest",
7+
"test:watch": "jest --watchAll"
228
},
23-
"homepage": "https://github.com/josecarneiro/lab-javascript-functions-and-arrays#readme",
24-
"engines": {
25-
"node": ">=15.11.0"
26-
},
27-
"dependencies": {
9+
"devDependencies": {
2810
"jest": "^26.6.3",
11+
"jest-html-reporter": "^3.3.0",
2912
"jest-junit": "^12.0.0"
3013
},
3114
"jest": {
32-
"transform": {}
15+
"reporters": [
16+
"default",
17+
[
18+
"./node_modules/jest-html-reporter",
19+
{
20+
"pageTitle": "Lab Solution",
21+
"outputPath": "lab-solution.html"
22+
}
23+
]
24+
]
3325
},
3426
"jest-junit": {
3527
"suiteNameTemplate": "{filepath}",
3628
"classNameTemplate": "{classname}",
3729
"titleTemplate": "{title}"
30+
},
31+
"prettier": {
32+
"printWidth": 120,
33+
"singleQuote": true,
34+
"trailingComma": "none"
3835
}
3936
}

0 commit comments

Comments
 (0)