| Total Complexity | 7 |
| Complexity/F | 1.17 |
| Lines of Code | 29 |
| Function Count | 6 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | const assert = require('assert'); |
||
| 2 | const ganache = require('ganache-cli'); |
||
| 3 | const Web3 = require('web3') |
||
| 4 | const web3 = new Web3(ganache.provider()); |
||
|
|
|||
| 5 | class Car { |
||
| 6 | park() { |
||
| 7 | return 'Stopped'; |
||
| 8 | } |
||
| 9 | drive() { |
||
| 10 | return 'gogo'; |
||
| 11 | } |
||
| 12 | } |
||
| 13 | |||
| 14 | let car; |
||
| 15 | |||
| 16 | beforeEach(() => { |
||
| 17 | console.log(' before each test:'); |
||
| 18 | car = new Car(); |
||
| 19 | }); |
||
| 20 | |||
| 21 | describe('Nguyen test Car class', () => { |
||
| 22 | it('can park', () => { |
||
| 23 | assert.equal(car.park(), 'Stopped'); |
||
| 24 | } ); |
||
| 25 | |||
| 26 | it('can drivde', () => { |
||
| 27 | assert.equal(car.drive(), 'gogo'); |
||
| 28 | } ); |
||
| 29 | } ) |
||
| 30 |