-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: ensure that the
reporter
is working correctly (#72)
- Loading branch information
1 parent
026066a
commit caaf11f
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
language: node_js | ||
node_js: | ||
- '10.13' | ||
before_script: | ||
- export DISPLAY=:99.0 | ||
- export CHROME_PATH="$(pwd)/chrome-linux/chrome" | ||
services: | ||
- xvfb | ||
addons: | ||
chrome: stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const writeReport = require('../lib/lighthouse-reporter'); | ||
|
||
describe('Reporter', () => { | ||
it('should launch Chrome and generate a report', async () => { | ||
jest.setTimeout(20000); // Allows more time to run all tests | ||
const result = await writeReport('http://www.google.com'); | ||
expect(result).toEqual( | ||
expect.objectContaining({ | ||
categoryReport: { | ||
performance: expect.any(Number), | ||
accessibility: expect.any(Number), | ||
'best-practices': expect.any(Number), | ||
seo: expect.any(Number), | ||
pwa: expect.any(Number), | ||
}, | ||
budgetsReport: expect.any(Object), | ||
htmlReport: expect.any(Object), | ||
jsonReport: expect.any(Object), | ||
}), | ||
); | ||
}); | ||
}); |