|
1 | 1 | import lighthousePlugin from './index.js'; |
2 | 2 |
|
3 | 3 | describe('lighthousePlugin plugin events', () => { |
4 | | - describe('onPostBuild', () => { |
5 | | - it('should return only the expected event function', async () => { |
| 4 | + describe('when fail_deploy_on_score_thresholds is true', () => { |
| 5 | + it('should return onPreBuild and onPostBuild events', async () => { |
6 | 6 | const events = lighthousePlugin({ |
7 | 7 | fail_deploy_on_score_thresholds: 'true', |
8 | 8 | }); |
9 | 9 | expect(events).toEqual({ |
10 | | - onPostBuild: expect.any(Function), |
| 10 | + onPreBuild: expect.any(Function), |
| 11 | + onPostBuild: expect.any(Function) |
11 | 12 | }); |
12 | 13 | }); |
13 | 14 | }); |
14 | 15 |
|
15 | | - describe('onSuccess', () => { |
16 | | - it('should return only the expected event function', async () => { |
| 16 | + describe('default behavior', () => { |
| 17 | + it('should return onPreBuild, onPostBuild and onSuccess events', async () => { |
17 | 18 | const events = lighthousePlugin(); |
18 | 19 | expect(events).toEqual({ |
19 | | - onSuccess: expect.any(Function), |
| 20 | + onPreBuild: expect.any(Function), |
| 21 | + onPostBuild: expect.any(Function), |
| 22 | + onSuccess: expect.any(Function) |
20 | 23 | }); |
21 | 24 | }); |
22 | 25 | }); |
|
0 commit comments