Skip to content

Commit 3b3543c

Browse files
authored
Update dependencies test (#484)
* 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
1 parent 416ce7a commit 3b3543c

File tree

9 files changed

+321
-1774
lines changed

9 files changed

+321
-1774
lines changed

.github/workflows/runtest.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@ jobs:
88
steps:
99
- name: Checkout the repository
1010
uses: actions/checkout@v2
11+
# https://github.com/web-platform-tests/results-analysis/pull/139
12+
# Currently, nodegit doesn't have support for Node 18. Have to
13+
# build the package from scratch.
14+
- name: Get packages for building node git
15+
uses: awalsh128/cache-apt-pkgs-action@v1
16+
with:
17+
packages: libssl-dev libkrb5-dev
18+
version: 1.0
1119
- name: Install NodeJS 18
12-
uses: actions/setup-node@v2
20+
uses: actions/setup-node@v3
1321
with:
1422
node-version: '18'
23+
cache: 'npm'
1524
- run: yarn --version
1625
- name: Install PostgreSQL 12
1726
run: |
@@ -42,5 +51,5 @@ jobs:
4251
run: yarn test
4352
- name: lighthouseci
4453
run: |
45-
npm install -g @lhci/cli@0.8.x
54+
npm install -g @lhci/cli@0.10.0
4655
yarn workspace client lighthouse

client/lighthouserc.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"ci": {
33
"assert": {
44
"assertions": {
5+
"categories:accessibility": ["error", {"minScore": 1}],
56
"accesskeys": ["error", {"minScore": 1}],
67
"aria-allowed-attr": ["error", {"minScore": 1}],
78
"aria-required-attr": ["error", {"minScore": 1}],
@@ -10,21 +11,18 @@
1011
"aria-roles": ["error", {"minScore": 1}],
1112
"aria-valid-attr-value": ["error", {"minScore": 1}],
1213
"aria-valid-attr": ["error", {"minScore": 1}],
13-
"audio-caption": ["error", {"minScore": 1}],
1414
"button-name": ["error", {"minScore": 1}],
1515
"bypass": ["error", {"minScore": 1}],
1616
"color-contrast": ["error", {"minScore": 1}],
1717
"definition-list": ["error", {"minScore": 1}],
1818
"dlitem": ["error", {"minScore": 1}],
1919
"document-title": ["error", {"minScore": 1}],
20-
"duplicate-id": ["error", {"minScore": 1}],
2120
"frame-title": ["error", {"minScore": 1}],
2221
"html-has-lang": ["error", {"minScore": 1}],
2322
"html-lang-valid": ["error", {"minScore": 1}],
2423
"image-alt": ["error", {"minScore": 1}],
2524
"input-image-alt": ["error", {"minScore": 1}],
2625
"label": ["error", {"minScore": 1}],
27-
"layout-table": ["error", {"minScore": 1}],
2826
"link-name": ["error", {"minScore": 1}],
2927
"list": ["error", {"minScore": 1}],
3028
"listitem": ["error", {"minScore": 1}],
@@ -35,14 +33,12 @@
3533
"td-headers-attr": ["error", {"minScore": 1}],
3634
"th-has-data-cells": ["error", {"minScore": 1}],
3735
"valid-lang": ["error", {"minScore": 1}],
38-
"video-caption": ["error", {"minScore": 1}],
39-
"video-description": ["error", {"minScore": 1}]
36+
"video-caption": ["error", {"minScore": 1}]
4037
}
4138
},
4239
"collect": {
4340
"startServerCommand": "npm run dev",
44-
"url": ["http://localhost:3000"],
45-
"chromeFlags": "--no-sandbox"
41+
"url": ["http://localhost:3000"]
4642
}
4743
}
4844
}

client/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"@babel/plugin-transform-runtime": "^7.9.0",
6161
"@babel/preset-env": "^7.8.7",
6262
"@babel/preset-react": "^7.8.3",
63-
"@lhci/cli": "^0.3.12",
63+
"@lhci/cli": "^0.10.0",
6464
"@storybook/addon-a11y": "^6.5.10",
6565
"@storybook/addon-actions": "^6.5.10",
6666
"@storybook/addon-controls": "^6.5.10",
@@ -113,7 +113,9 @@
113113
"setupFilesAfterEnv": [
114114
"./jest.setup.js"
115115
],
116-
"transformIgnorePatterns": ["<rootDir>/node_modules/(?!(@juggle/resize-observer|@react-hook/resize-observer)/)"],
116+
"transformIgnorePatterns": [
117+
"<rootDir>/node_modules/(?!(@juggle/resize-observer|@react-hook/resize-observer)/)"
118+
],
117119
"transform": {
118120
"^.+\\.(js|jsx|mjs)$": "babel-jest"
119121
},

client/tests/App.test.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @jest-environment jsdom
3+
*/
4+
15
import React from 'react';
26
import Enzyme, { shallow } from 'enzyme';
37
import EnzymeAdapter from 'enzyme-adapter-react-16';

client/tests/TestRun.test.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @jest-environment jsdom
3+
*/
4+
15
import React from 'react';
26
import Enzyme, { shallow } from 'enzyme';
37
import EnzymeAdapter from 'enzyme-adapter-react-16';

client/utils/gitUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export const gitUpdatedDateToString = (dateString, locale = 'default') => {
77
const month = date.toLocaleString(locale, options);
88
const day = date.getDate();
99
const year = date.getFullYear();
10-
const time = date.toLocaleTimeString(locale, { timeZone: timeZone });
10+
const time = date
11+
.toLocaleTimeString(locale, { timeZone: timeZone })
12+
.replace(/\s/g, ' ');
1113

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

client/utils/gitUtils.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ describe('gitUpdatedDateToString', () => {
1616
it('returns a formatted string when using 24-hour notation in a different locale (Dutch)', () => {
1717
const date = '2021-11-30T14:51:28.000Z';
1818
const formattedDate = gitUpdatedDateToString(date, 'nl-NL');
19-
// Dutch time uses a lowercase period-terminated month notation
20-
expect(formattedDate).toBe('nov. 30, 2021 at 14:51:28 UTC');
19+
// Dutch time uses a lowercase month notation
20+
expect(formattedDate).toBe('nov 30, 2021 at 14:51:28 UTC');
2121
});
2222

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

0 commit comments

Comments
 (0)