Skip to content

Commit 737e44e

Browse files
committed
Fix instructions, export classes from source file
1 parent fc59919 commit 737e44e

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,19 @@ We have learned Object-oriented programming and how `class` and inheritance work
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.
2525

2626
### Test, test, test!
2727

28-
Yes! The best way to ensure your code is doing what is expected is to constantly test. Go ahead and open the file `SpecRunner.html`!
29-
30-
**Run the tests**
28+
Please, open your terminal, change directories into the root of the lab, and run `npm install` to install the test runner. Now, you can run the `npm run test:watch` command to run automated tests in _watch mode_. Open the resulting `lab-solution.html` file with the "Live Server" VSCode extension to always see the most up to date test results.
3129

32-
We have got a _test suite_ for our constructor functions and their methods but there are no tests currently being executed. We have to uncomment each `it()` inside of `tests/viking.spec.js` and implement the code in `src/viking.js` to make each test pass.
30+
We have got a _test suite_ for our classes and their methods but there are no tests currently being executed. We have to uncomment each `it()` inside of `tests/viking.spec.js` and implement the code in `src/viking.js` to make each test pass.
3331

3432
If you open `tests/viking.spec.js` and take a look at **lines 11-21**, You should see some `it()` calls (tests) that are commented out. Let's start by uncommenting **lines 11-13**:
3533

src/viking.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ class Saxon {}
99

1010
// War
1111
class War {}
12+
13+
// The following is required to make unit tests work. Please ignore it.
14+
if (typeof module !== 'undefined') {
15+
module.exports = { Soldier, Viking, Saxon, War };
16+
}

0 commit comments

Comments
 (0)