|
1 | | -var expect = require('chai').expect; |
| 1 | +const expect = require('chai').expect; |
2 | 2 |
|
3 | | -/// load('01/data.js', true) |
4 | | -/// load('page-01.js') |
| 3 | +const page = require('BASE/page-01.js'); |
5 | 4 |
|
6 | | -describe('01 addOne', function() { |
| 5 | +describe('01 addOne', () => { |
7 | 6 |
|
8 | | - it('doesn\'t exist', function() { |
9 | | - expect(addOne).to.be.defined; |
10 | | - }); |
| 7 | + const addOne = page.__get__('addOne'); |
11 | 8 |
|
12 | | - it('should take a parameter', function() { |
| 9 | + it('should take a parameter', () => { |
13 | 10 | expect(addOne).to.have.length(1); |
14 | 11 | }); |
15 | 12 |
|
16 | | - it('doesn\'t return anything', function() { |
| 13 | + it('doesn\'t return anything', () => { |
17 | 14 | expect(addOne(1)).to.exist; |
18 | 15 | }); |
19 | 16 |
|
20 | | - it('should output a number', function() { |
| 17 | + it('should output a number', () => { |
21 | 18 | expect(addOne(1)).to.be.a('number'); |
22 | 19 | }); |
23 | 20 |
|
24 | | - it('doesn\'t add 1 + 1', function() { |
| 21 | + it('doesn\'t add 1 + 1', () => { |
25 | 22 | expect(addOne(1)).to.equal(2); |
26 | 23 | expect(addOne(10)).to.equal(11); |
27 | 24 | }); |
|
0 commit comments