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

feat: Lighthouse Setup #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: Lighthouse Setup #31

wants to merge 1 commit into from

Conversation

colbyallenc
Copy link

Jira Card:

✍️ Description

LightHouse setup.

The following steps outline the added experience by the pull request:

  • Pull this brach down.
  • Run npm i
  • Run npm run lighthouse

@ethanmuller
Copy link
Contributor

I haven't worked with automated Lighthouse on a project yet.

Looks like it does some automated a11y testing, plus performance testing, plus other stuff? I love the sound of this!

Right now it looks like it only gets run when explicitly asking npm to explicitly run npm run lighthouse. I'm afraid that this means it'll only get run by the people who are aware of it. In the past, how has Lighthouse fit into our process? Do we ever run it automatically, like on CI or something? Just don't want to add it as a secret feature. 😄

Also, we currently have pa11y set up in this project. Would it make sense for this to replace that? (It currently runs in our lint script, which I think is... a bad place for it to live)

@@ -1,7 +1,7 @@
const express = require('express');

const app = express();
const PORT = process.env.PORT || 3000;
const PORT = process.env.PORT || 3030;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for this port change? It looks like Lighthouse is still trying to access 3000. I see this flash before the Lighthouse script ends:

image

Copy link
Contributor

@ethanmuller ethanmuller Dec 18, 2019

Choose a reason for hiding this comment

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

If I locally change the port back to 3000, I see a flash of the Design System interface, which feels like a step in the right direction. However I still get this result:

> [email protected] lighthouse /Users/ethanmuller/git/design-system-starter
> node tasks/lighthouse.js

Error:  { id: 'aria-roles',
  title: '`[role]` values are valid',
  description:
   'ARIA roles must have valid values in order to perform their intended accessibility functions. [Learn more](https://web.dev/aria-roles/).',
  score: null,
  scoreDisplayMode: 'notApplicable',
  numericValue: undefined,
  displayValue: undefined,
  explanation: undefined,
  errorMessage: undefined,
  warnings: undefined,
  details: undefined }
(node:45406) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'items' of undefined
    at audits.forEach.audit (/Users/ethanmuller/git/design-system-starter/tasks/lighthouse.js:81:52)
    at Array.forEach (<anonymous>)
    at launchChromeAndRunLighthouse.then.results (/Users/ethanmuller/git/design-system-starter/tasks/lighthouse.js:78:12)
(node:45406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:45406) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Are you getting the same result? I can't tell if this is the script failing, or if it's Lighthouse doing its job.

};

const urls = [
'http://localhost:3000',
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we need to maintain this list of URLs to test new pages as we make them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants