Fix unit tests and make tests fail if a promise rejects after the test harness is finishes (#2034)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-03-30 10:14:05 -04:00
1 parent a4ba77c58b
commit 503a49261e
15 files changed
+153 -166

No files matched your search

+2 -1
View File
@@ -35,7 +35,8 @@ jest.mock("electron", () => {
app: {
getVersion: () => "99.99.99",
getPath: () => "tmp",
getLocale: () => "en"
getLocale: () => "en",
setLoginItemSettings: jest.fn(),
},
ipcMain: {
handle: jest.fn(),
@@ -1,7 +1,3 @@
/**
* @jest-environment jsdom
*/
import { SearchStore } from "../search-store";
let searchStore: SearchStore = null;
+6 -1
View File
@@ -1,3 +1,7 @@
import { Console } from "console";
console = new Console(process.stdout, process.stderr);
import mockFs from "mock-fs";
jest.mock("electron", () => {
@@ -5,7 +9,8 @@ jest.mock("electron", () => {
app: {
getVersion: () => "99.99.99",
getPath: () => "tmp",
getLocale: () => "en"
getLocale: () => "en",
setLoginItemSettings: jest.fn(),
}
};
});
+2 -1
View File
@@ -5,7 +5,8 @@ jest.mock("electron", () => {
app: {
getVersion: () => "99.99.99",
getPath: () => "tmp",
getLocale: () => "en"
getLocale: () => "en",
setLoginItemSettings: jest.fn(),
},
ipcMain: {
handle: jest.fn(),