Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched to vitest #1884

Merged
merged 23 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
47e79c3
Removed leftover webpack config
marekdedic Jan 15, 2025
9111ad4
Added basic vitest test
marekdedic Jan 15, 2025
523419f
Added vitest linting
marekdedic Jan 15, 2025
bfeb5c2
Migrated listFolders test to vitest
marekdedic Jan 15, 2025
bc51712
Migrated listSharedDrives test to vitest
marekdedic Jan 15, 2025
2e86b69
Migrated DriveBackedValue test to vitest
marekdedic Jan 15, 2025
e94c709
Migrated MoveState test to vitest
marekdedic Jan 15, 2025
e7d4b15
Migrated paginationHelper test to vitest
marekdedic Jan 15, 2025
944df08
Migrated SafeDriveService test to vitest
marekdedic Jan 15, 2025
52a95ef
Migrated SafeCommentsCollection test to vitest
marekdedic Jan 15, 2025
fe6fc36
Migrated SafeDrivesCollection test to vitest
marekdedic Jan 15, 2025
9e3c373
Migrated SafeFilesCollection test to vitest
marekdedic Jan 15, 2025
5ba8bc1
Migrated move test to vitest
marekdedic Jan 15, 2025
3bfb2e2
Migrated copyFileComments test to vitest
marekdedic Jan 15, 2025
479f2a2
Migrated folderManagement test to vitest
marekdedic Jan 15, 2025
da47021
Migrated moveFile test to vitest
marekdedic Jan 15, 2025
7e373b0
Migrated moveFolder test to vitest
marekdedic Jan 15, 2025
a6f3f24
Migrated resolveDestinationFolder test to vitest
marekdedic Jan 15, 2025
f88b027
Separated test-utils between frontend and backend
marekdedic Jan 15, 2025
c3a26a6
Moved playwright tests to tests/
marekdedic Jan 15, 2025
bf0b772
Removed jest
marekdedic Jan 15, 2025
2296337
Separated test and test with coverage
marekdedic Jan 15, 2025
57297f6
Eslint suppressions
marekdedic Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Migrated SafeCommentsCollection test to vitest
  • Loading branch information
marekdedic committed Jan 15, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 52a95ef0e494c22b0e129ae28d421ffd08813c91
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { expect, test } from "@jest/globals";
import { mocked } from "jest-mock";
import { expect, test, vi } from "vitest";

import { SafeCommentsCollection_ } from "../../../../src/backend/utils/SafeDriveService/SafeCommentsCollection";
import {
@@ -48,9 +47,9 @@ test("insert works", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const insert = mocked(global.Drive.Comments).insert.mockReturnValueOnce(
comment,
);
const insert = vi
.mocked(global.Drive.Comments)
.insert.mockReturnValueOnce(comment);

const commentsCollection = new SafeCommentsCollection_();

@@ -80,9 +79,9 @@ test("insert throws an error on an invalid comment", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const insert = mocked(global.Drive.Comments).insert.mockReturnValueOnce(
comment,
);
const insert = vi
.mocked(global.Drive.Comments)
.insert.mockReturnValueOnce(comment);

const commentsCollection = new SafeCommentsCollection_();

@@ -134,9 +133,9 @@ test("list works", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const list = mocked(global.Drive.Comments).list.mockReturnValueOnce(
commentList,
);
const list = vi
.mocked(global.Drive.Comments)
.list.mockReturnValueOnce(commentList);

const commentsCollection = new SafeCommentsCollection_();

@@ -188,9 +187,9 @@ test("list works with optional arguments", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const list = mocked(global.Drive.Comments).list.mockReturnValueOnce(
commentList,
);
const list = vi
.mocked(global.Drive.Comments)
.list.mockReturnValueOnce(commentList);

const commentsCollection = new SafeCommentsCollection_();

@@ -249,9 +248,9 @@ test("list throws an error on an invalid comment", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const list = mocked(global.Drive.Comments).list.mockReturnValueOnce(
commentList,
);
const list = vi
.mocked(global.Drive.Comments)
.list.mockReturnValueOnce(commentList);

const commentsCollection = new SafeCommentsCollection_();

@@ -268,9 +267,9 @@ test("list throws an error on an invalid comment list", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const list = mocked(global.Drive.Comments).list.mockReturnValueOnce(
commentList,
);
const list = vi
.mocked(global.Drive.Comments)
.list.mockReturnValueOnce(commentList);

const commentsCollection = new SafeCommentsCollection_();

@@ -313,9 +312,9 @@ test("list throws an error on missing replies", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const list = mocked(global.Drive.Comments).list.mockReturnValueOnce(
commentList,
);
const list = vi
.mocked(global.Drive.Comments)
.list.mockReturnValueOnce(commentList);

const commentsCollection = new SafeCommentsCollection_();

@@ -366,9 +365,9 @@ test("list throws an error on an invalid reply", () => {
};

global.Drive.Comments = mockedCommentsCollection();
const list = mocked(global.Drive.Comments).list.mockReturnValueOnce(
commentList,
);
const list = vi
.mocked(global.Drive.Comments)
.list.mockReturnValueOnce(commentList);

const commentsCollection = new SafeCommentsCollection_();