Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize sample.json test fixture according to latest output #1791

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lighthouse-cli/test/cli/printer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require('../../compiled-check.js')('printer.js');
const Printer = require('../../printer.js');
const assert = require('assert');
const fs = require('fs');
const sampleResults = require('../fixtures/sample.json');
const sampleResults = require('../../../lighthouse-core/test/results/sample.json');
const log = require('../../../lighthouse-core/lib/log');

describe('Printer', () => {
Expand Down Expand Up @@ -87,7 +87,7 @@ describe('Printer', () => {
const mode = 'pretty';
const prettyOutput = Printer.createOutput(sampleResults, mode);
const output = new RegExp(log.heavyHorizontal + log.heavyHorizontal +
' images\/chrome-touch-icon-384x384.png', 'i');
' dobetterweb/dbw_tester.css', 'i');

assert.ok(output.test(prettyOutput));
});
Expand Down
593 changes: 0 additions & 593 deletions lighthouse-cli/test/fixtures/sample.json

This file was deleted.

4 changes: 3 additions & 1 deletion lighthouse-core/test/report/report-generator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('Report', () => {
it('should format generated Time', () => {
const reportGenerator = new ReportGenerator();
const html = reportGenerator.generateHTML(sampleResults);
assert.ok(/on: 11\/\d{1,2}\/2016\, /gim.test(html));
assert.ok(/on: 2\/\d{1,2}\/2017\, /gim.test(html));
});

it('should escape closing </script> tags', () => {
Expand Down Expand Up @@ -87,6 +87,8 @@ describe('Report', () => {
assert.ok(html.includes('data-action="save-json" '), 'has save json button');
assert.ok(html.includes('class="report__icon copy"'), 'has copy button');
assert.ok(html.includes('class="report__icon print"'), 'has print button');
assert.ok(html.includes(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to cover #1790 (comment) in the future.

'<code>&lt;meta name=&quot;viewport&quot;&gt;</code>'), 'escapes <code>, once.');
});

it('does not include script for devtools', () => {
Expand Down
Loading