Skip to content

Commit

Permalink
chore: stop using legacy deps, use --force for now. Update @reduxjs/t…
Browse files Browse the repository at this point in the history
…oolkit and move more test files to .mjs
  • Loading branch information
Standard8 committed Feb 25, 2024
1 parent 4e96abe commit 1796155
Show file tree
Hide file tree
Showing 19 changed files with 333 additions and 130 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Install dependencies
run: npm ci
run: npm ci --force
- name: eslint
run: npm run test:lint
- name: Prettier
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Install dependencies
run: npm ci
run: npm ci --force
- name: Run jest tests
run: npm run test:jest
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 0 additions & 1 deletion addon/content/stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ document.addEventListener(

let store = RTK.configureStore({
reducer: conversationApp,
middleware: RTK.getDefaultMiddleware(),
});

// Once we can potentially load in a WebExtension scope, then we should
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import { createFakeData } from "./utils.js";
import { jest } from "@jest/globals";
import { createFakeData } from "./utils.mjs";
import { conversationUtils } from "../content/reducer/conversationUtils.js";

describe("conversationUtils", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import { createFakeData, createFakeSummaryData } from "./utils.js";
import { jest } from "@jest/globals";
import { createFakeData, createFakeSummaryData } from "./utils.mjs";
import { MessageEnricher } from "../content/reducer/messageEnricher.js";

describe("messageEnricher", () => {
Expand Down Expand Up @@ -174,16 +173,16 @@ describe("messageEnricher", () => {

mailTabsGetSpy.mockReturnValue(false);

for (let test of tests) {
let fakeMsg = createFakeData(test.source, fakeMessageHeaderData);
for (let t of tests) {
let fakeMsg = createFakeData(t.source, fakeMessageHeaderData);

let msgs = await messageEnricher.enrich(
[fakeMsg],
createFakeSummaryData({ noFriendlyDate: true }),
[3]
);

expect(msgs[0]).toMatchObject(test.expected);
expect(msgs[0]).toMatchObject(t.expected);
}
});

Expand Down
2 changes: 0 additions & 2 deletions addon/tests/prefs.test.js → addon/tests/prefs.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
kCurrentLegacyMigration,
} from "../background/prefs.mjs";

import { jest } from "@jest/globals";

describe("Prefs tests", () => {
let prefs;

Expand Down
1 change: 0 additions & 1 deletion addon/tests/quickReply.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe("Quick Reply tests", () => {
beforeEach(async () => {
store = RTK.configureStore({
reducer: conversationApp,
middleware: RTK.getDefaultMiddleware(),
});
quickReplyActions.expand = jest.fn().mockImplementation(() => {
return {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import { jest } from "@jest/globals";
import * as RTK from "@reduxjs/toolkit";
import * as Redux from "redux";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import { createFakeData, createFakeSummaryData } from "./utils.js";
import { jest } from "@jest/globals";
import { createFakeData, createFakeSummaryData } from "./utils.mjs";
import * as RTK from "@reduxjs/toolkit";
import * as Redux from "redux";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import { jest } from "@jest/globals";
import * as RTK from "@reduxjs/toolkit";
import * as Redux from "redux";
import { createFakeData } from "./utils.js";
import { createFakeData } from "./utils.mjs";

// Import the components we want to test
import {
Expand Down
1 change: 1 addition & 0 deletions addon/tests/setup.js → addon/tests/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/* eslint-env node */

// eslint-disable-next-line no-shadow
import { browser } from "../content/esmodules/thunderbirdCompat.js";
import fileSystem from "fs";
import path from "path";
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function (api) {
{
targets: { browsers: "Firefox >= 110.0" },
// Use commonjs for now until the ecosystem sorts itself out.
modules: "commonjs",
modules: "auto",
},
],
[
Expand Down
Loading

0 comments on commit 1796155

Please sign in to comment.