Skip to content

Commit

Permalink
Update dependencies test (#484)
Browse files Browse the repository at this point in the history
* Updating jest environment and babel configuration

* Trying nodegit 18 to fix builds

* New github config to fix builds

* Cacheing nodegit and fixing failing tests

* Upgrade lighthouse
  • Loading branch information
evmiguel authored and howard-e committed Feb 9, 2023
1 parent 8aed201 commit 7f2c2b2
Show file tree
Hide file tree
Showing 9 changed files with 321 additions and 1,774 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/runtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v2
# https://github.com/web-platform-tests/results-analysis/pull/139
# Currently, nodegit doesn't have support for Node 18. Have to
# build the package from scratch.
- name: Get packages for building node git
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: libssl-dev libkrb5-dev
version: 1.0
- name: Install NodeJS 18
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- run: yarn --version
- name: Install PostgreSQL 12
run: |
Expand Down Expand Up @@ -42,5 +51,5 @@ jobs:
run: yarn test
- name: lighthouseci
run: |
npm install -g @lhci/cli@0.8.x
npm install -g @lhci/cli@0.10.0
yarn workspace client lighthouse
File renamed without changes.
10 changes: 3 additions & 7 deletions client/lighthouserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"ci": {
"assert": {
"assertions": {
"categories:accessibility": ["error", {"minScore": 1}],
"accesskeys": ["error", {"minScore": 1}],
"aria-allowed-attr": ["error", {"minScore": 1}],
"aria-required-attr": ["error", {"minScore": 1}],
Expand All @@ -10,21 +11,18 @@
"aria-roles": ["error", {"minScore": 1}],
"aria-valid-attr-value": ["error", {"minScore": 1}],
"aria-valid-attr": ["error", {"minScore": 1}],
"audio-caption": ["error", {"minScore": 1}],
"button-name": ["error", {"minScore": 1}],
"bypass": ["error", {"minScore": 1}],
"color-contrast": ["error", {"minScore": 1}],
"definition-list": ["error", {"minScore": 1}],
"dlitem": ["error", {"minScore": 1}],
"document-title": ["error", {"minScore": 1}],
"duplicate-id": ["error", {"minScore": 1}],
"frame-title": ["error", {"minScore": 1}],
"html-has-lang": ["error", {"minScore": 1}],
"html-lang-valid": ["error", {"minScore": 1}],
"image-alt": ["error", {"minScore": 1}],
"input-image-alt": ["error", {"minScore": 1}],
"label": ["error", {"minScore": 1}],
"layout-table": ["error", {"minScore": 1}],
"link-name": ["error", {"minScore": 1}],
"list": ["error", {"minScore": 1}],
"listitem": ["error", {"minScore": 1}],
Expand All @@ -35,14 +33,12 @@
"td-headers-attr": ["error", {"minScore": 1}],
"th-has-data-cells": ["error", {"minScore": 1}],
"valid-lang": ["error", {"minScore": 1}],
"video-caption": ["error", {"minScore": 1}],
"video-description": ["error", {"minScore": 1}]
"video-caption": ["error", {"minScore": 1}]
}
},
"collect": {
"startServerCommand": "npm run dev",
"url": ["http://localhost:3000"],
"chromeFlags": "--no-sandbox"
"url": ["http://localhost:3000"]
}
}
}
6 changes: 4 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.8.7",
"@babel/preset-react": "^7.8.3",
"@lhci/cli": "^0.3.12",
"@lhci/cli": "^0.10.0",
"@storybook/addon-a11y": "^6.5.10",
"@storybook/addon-actions": "^6.5.10",
"@storybook/addon-controls": "^6.5.10",
Expand Down Expand Up @@ -113,7 +113,9 @@
"setupFilesAfterEnv": [
"./jest.setup.js"
],
"transformIgnorePatterns": ["<rootDir>/node_modules/(?!(@juggle/resize-observer|@react-hook/resize-observer)/)"],
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!(@juggle/resize-observer|@react-hook/resize-observer)/)"
],
"transform": {
"^.+\\.(js|jsx|mjs)$": "babel-jest"
},
Expand Down
4 changes: 4 additions & 0 deletions client/tests/App.test.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @jest-environment jsdom
*/

import React from 'react';
import Enzyme, { shallow } from 'enzyme';
import EnzymeAdapter from 'enzyme-adapter-react-16';
Expand Down
4 changes: 4 additions & 0 deletions client/tests/TestRun.test.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @jest-environment jsdom
*/

import React from 'react';
import Enzyme, { shallow } from 'enzyme';
import EnzymeAdapter from 'enzyme-adapter-react-16';
Expand Down
4 changes: 3 additions & 1 deletion client/utils/gitUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export const gitUpdatedDateToString = (dateString, locale = 'default') => {
const month = date.toLocaleString(locale, options);
const day = date.getDate();
const year = date.getFullYear();
const time = date.toLocaleTimeString(locale, { timeZone: timeZone });
const time = date
.toLocaleTimeString(locale, { timeZone: timeZone })
.replace(/\s/g, ' ');

const timeStamp = `${month} ${day}, ${year} at ${time} ${timeZone}`;

Expand Down
4 changes: 2 additions & 2 deletions client/utils/gitUtils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('gitUpdatedDateToString', () => {
it('returns a formatted string when using 24-hour notation in a different locale (Dutch)', () => {
const date = '2021-11-30T14:51:28.000Z';
const formattedDate = gitUpdatedDateToString(date, 'nl-NL');
// Dutch time uses a lowercase period-terminated month notation
expect(formattedDate).toBe('nov. 30, 2021 at 14:51:28 UTC');
// Dutch time uses a lowercase month notation
expect(formattedDate).toBe('nov 30, 2021 at 14:51:28 UTC');
});

it('returns a formatted string when using a different locale (Korean)', () => {
Expand Down
Loading

0 comments on commit 7f2c2b2

Please sign in to comment.