Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
exterkamp committed Jan 14, 2020
1 parent 3301b18 commit 4c89c0f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 45 deletions.
73 changes: 30 additions & 43 deletions lighthouse-core/test/audits/seo/is-crawlable-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,12 @@ describe('SEO: Is page crawlable audit', () => {

it('fails when page is blocked from indexing with a header', () => {
const robotsHeaders = [
[
{name: 'x-robots-tag', value: 'noindex'},
],
[
{name: 'X-Robots-Tag', value: 'all'},
{name: 'x-robots-tag', value: 'none'},
],
[
{name: 'X-ROBOTS-TAG', value: 'all, none'},
],
[
{name: 'x-robots-tag', value: ' noindex '},
],
[
{name: 'x-robots-tag', value: 'unavailable_after: 25 Jun 2010 15:00:00 PST'},
],
[
{name: 'x-robots-tag', value: 'all, unavailable_after: 25-Jun-2010 15:00:00 PST'},
],
[{name: 'x-robots-tag', value: 'noindex'}],
[{name: 'X-Robots-Tag', value: 'all'}, {name: 'x-robots-tag', value: 'none'}],
[{name: 'X-ROBOTS-TAG', value: 'all, none'}],
[{name: 'x-robots-tag', value: ' noindex '}],
[{name: 'x-robots-tag', value: 'unavailable_after: 25 Jun 2010 15:00:00 PST'}],
[{name: 'x-robots-tag', value: 'all, unavailable_after: 25-Jun-2010 15:00:00 PST'}],
];

const allRuns = robotsHeaders.map(headers => {
Expand Down Expand Up @@ -320,30 +307,30 @@ describe('SEO: Is page crawlable audit', () => {
assert.equal(auditResult.details.items.length, 4);

expect(auditResult.details.items).toMatchInlineSnapshot(`
Array [
Object {
"source": Object {
"snippet": "<meta name=\\"robots\\" content=\\"noindex\\" />",
"type": "node",
},
},
Object {
"source": "x-robots-tag: none",
},
Object {
"source": "x-robots-tag: noindex",
},
Object {
"source": Object {
"column": 0,
"line": 1,
"type": "source-location",
"url": "http://example.com/robots.txt",
"urlProvider": "network",
},
},
]
`);
Array [
Object {
"source": Object {
"snippet": "<meta name=\\"robots\\" content=\\"noindex\\" />",
"type": "node",
},
},
Object {
"source": "x-robots-tag: none",
},
Object {
"source": "x-robots-tag: noindex",
},
Object {
"source": Object {
"column": 0,
"line": 1,
"type": "source-location",
"url": "http://example.com/robots.txt",
"urlProvider": "network",
},
},
]
`);
});
});
});
4 changes: 2 additions & 2 deletions lighthouse-core/test/lib/minification-estimator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ describe('minification estimator', () => {
});

it('should handle large, real javscript files', () => {
assert.equal(angularFullScript.length, 1371888);
assert.equal(angularFullScript.length, 1364217);
// 1 - 334968 / 1364217 = estimated 75% smaller minified
assert.equal(computeJSTokenLength(angularFullScript), 337959);
assert.equal(computeJSTokenLength(angularFullScript), 334968);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ describe('ReportRenderer', () => {
// https://github.com/dequelabs/axe-core/tree/b573b1c1/doc/examples/jest_react#to-run-the-example
'color-contrast': {enabled: false},
'link-in-text-block': {enabled: false},
// The report contains empty links prior to i18n-ing.
'link-name': {enabled: false},
},
};

Expand Down

0 comments on commit 4c89c0f

Please sign in to comment.