feat: upgraded to node v18, added .nvmrc and updated workflows (#151)
This commit is contained in:
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -11,17 +11,17 @@ on:
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
node: [16]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Nodejs Env
|
||||
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Nodejs
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
node-version: ${{ env.NODE_VER }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
2
.github/workflows/lockfileversion-check.yml
vendored
2
.github/workflows/lockfileversion-check.yml
vendored
@@ -10,4 +10,4 @@ on:
|
||||
|
||||
jobs:
|
||||
version-check:
|
||||
uses: edx/.github/.github/workflows/lockfileversion-check.yml@master
|
||||
uses: edx/.github/.github/workflows/lockfileversion-check-v3.yml@master
|
||||
|
||||
9
.github/workflows/npm-publish.yml
vendored
9
.github/workflows/npm-publish.yml
vendored
@@ -10,14 +10,17 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Nodejs Env
|
||||
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12
|
||||
node-version: ${{ env.NODE_VER }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
35161
package-lock.json
generated
35161
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -77,7 +77,7 @@
|
||||
"whatwg-fetch": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@edx/frontend-build": "11.0.1",
|
||||
"@edx/frontend-build": "12.8.27",
|
||||
"@edx/reactifex": "^2.1.1",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^12.1.0",
|
||||
@@ -91,6 +91,6 @@
|
||||
"react-dev-utils": "^11.0.4",
|
||||
"react-test-renderer": "^16.14.0",
|
||||
"redux-mock-store": "^1.5.4",
|
||||
"semantic-release": "^17.4.5"
|
||||
"semantic-release": "^20.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,11 +36,9 @@ export const CourseBanner = ({ cardId }) => {
|
||||
<Banner>
|
||||
{formatMessage(messages.auditAccessExpired)}
|
||||
{' '}
|
||||
{
|
||||
<Hyperlink isInline destination="">
|
||||
{formatMessage(messages.findAnotherCourse)}
|
||||
</Hyperlink>
|
||||
}
|
||||
<Hyperlink isInline destination="">
|
||||
{formatMessage(messages.findAnotherCourse)}
|
||||
</Hyperlink>
|
||||
</Banner>
|
||||
))}
|
||||
|
||||
|
||||
@@ -17,9 +17,8 @@ const cardId = 'test-card-id';
|
||||
const state = new MockUseState(hooks);
|
||||
const numPrograms = 27;
|
||||
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
describe('RelatedProgramsBadge hooks', () => {
|
||||
const { formatMessage } = useIntl();
|
||||
let out;
|
||||
describe('state values', () => {
|
||||
state.testGetter(state.keys.isOpen);
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('MasqueradeBar hooks', () => {
|
||||
isMasqueradingPending: false,
|
||||
masqueradeErrorStatus: null,
|
||||
};
|
||||
const createHook = (masqueradeData = {}, user) => {
|
||||
const createHook = (masqueradeData = {}, user = undefined) => {
|
||||
reduxHooks.useMasqueradeData.mockReturnValueOnce({
|
||||
...defaultMasqueradeData,
|
||||
...masqueradeData,
|
||||
|
||||
@@ -61,8 +61,6 @@ const entitlementData = {
|
||||
uuid,
|
||||
};
|
||||
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
const testValue = 'test-value';
|
||||
|
||||
const courseId = 'test-course-id';
|
||||
@@ -125,6 +123,7 @@ describe('SelectSessionModal hooks', () => {
|
||||
});
|
||||
|
||||
describe('output', () => {
|
||||
const { formatMessage } = useIntl();
|
||||
describe('selectedSession', () => {
|
||||
it('defaults to current courseId if enrolled', () => {
|
||||
expect(out.selectedSession).toEqual(courseId);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable react-hooks/rules-of-hooks */
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
|
||||
import * as redux from 'data/redux';
|
||||
|
||||
@@ -28,9 +28,7 @@ const genRequests = (request) => ({
|
||||
requests: { [requestKey]: request },
|
||||
});
|
||||
const select = (selector, request) => (
|
||||
mockUseSelector(
|
||||
selector(requestKey), genRequests(request),
|
||||
)
|
||||
mockUseSelector(selector(requestKey), genRequests(request))
|
||||
);
|
||||
describe('requests selectors unit tests', () => {
|
||||
test('requestStatus returns data associated with given key', () => {
|
||||
@@ -38,8 +36,10 @@ describe('requests selectors unit tests', () => {
|
||||
});
|
||||
const testStatusSelector = (selector, matchingRequest) => {
|
||||
expect(mockUseSelector(selector(requestKey), testState)).toEqual(false);
|
||||
expect(mockUseSelector(selector(requestKey),
|
||||
{ requests: { [requestKey]: matchingRequest } })).toEqual(true);
|
||||
expect(mockUseSelector(
|
||||
selector(requestKey),
|
||||
{ requests: { [requestKey]: matchingRequest } },
|
||||
)).toEqual(true);
|
||||
};
|
||||
test('isInactive returns true iff the given request is inactive', () => {
|
||||
testStatusSelector(selectors.isInactive, inactiveRequest);
|
||||
|
||||
@@ -86,8 +86,10 @@ describe('lms api methods', () => {
|
||||
expect(
|
||||
api.updateEmailSettings({ courseId, enable: true }),
|
||||
).toEqual(
|
||||
utils.post(urls.updateEmailSettings,
|
||||
{ [apiKeys.courseId]: courseId, ...enableEmailsAction }),
|
||||
utils.post(
|
||||
urls.updateEmailSettings,
|
||||
{ [apiKeys.courseId]: courseId, ...enableEmailsAction },
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -97,8 +99,10 @@ describe('lms api methods', () => {
|
||||
expect(
|
||||
api.unenrollFromCourse({ courseId }),
|
||||
).toEqual(
|
||||
utils.post(urls.courseUnenroll,
|
||||
{ [apiKeys.courseId]: courseId, ...unenrollmentAction }),
|
||||
utils.post(
|
||||
urls.courseUnenroll,
|
||||
{ [apiKeys.courseId]: courseId, ...unenrollmentAction },
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -56,8 +56,10 @@ describe('course trackers', () => {
|
||||
describe('upgradeButtonClickedUpsell', () => {
|
||||
it('creates an event tracker for upgradeButtonClickedUpsell eventwith upsellOptions', () => {
|
||||
expect(trackers.upgradeButtonClickedUpsell(courseId)).toEqual(
|
||||
createEventTracker(eventNames.upgradeButtonClickedUpsell,
|
||||
{ ...trackers.upsellOptions, courseId }),
|
||||
createEventTracker(
|
||||
eventNames.upgradeButtonClickedUpsell,
|
||||
{ ...trackers.upsellOptions, courseId },
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,7 +22,8 @@ describe('find courses trackers', () => {
|
||||
findCoursesClicked(url);
|
||||
expect(createEventTracker).toHaveBeenCalledWith(eventNames.findCoursesClicked, defaultProps);
|
||||
expect(createLinkTracker).toHaveBeenCalledWith(
|
||||
createEventTracker(eventNames.findCoursesClicked, defaultProps), url,
|
||||
createEventTracker(eventNames.findCoursesClicked, defaultProps),
|
||||
url,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user