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

feat(component-testing): implement mocks #1027

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
106 changes: 106 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@jspm/core": "2.0.1",
"@types/debug": "4.1.12",
"@types/yallist": "4.0.4",
"@vitest/spy": "2.1.4",
"@wdio/globals": "8.39.0",
"@wdio/protocols": "8.38.0",
"@wdio/types": "8.39.0",
Expand All @@ -81,6 +82,7 @@
"mocha": "10.2.0",
"plugins-loader": "1.3.4",
"png-validator": "1.1.0",
"recast": "0.23.6",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used in browser env in order to correctly modify ast tree to correctly work with mock

"resolve.exports": "2.0.2",
"sharp": "0.32.6",
"sizzle": "2.3.6",
Expand All @@ -90,6 +92,7 @@
"strftime": "0.10.2",
"strip-ansi": "6.0.1",
"temp": "0.8.3",
"tinyspy": "3.0.2",
"urijs": "1.19.11",
"url-join": "4.0.1",
"vite": "5.1.6",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "expect-webdriverio";
import { GlobalHelper } from "./types";
export { Testplane as default } from "./testplane";
export { Key } from "webdriverio";
export * from "./mock";

export type {
WdioBrowser,
Expand Down
10 changes: 10 additions & 0 deletions src/mock/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export * from "./vitest-spy";

// TODO: use from browser code when migrate to esm
type MockFactory = (originalImport?: unknown) => unknown;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function mock(_moduleName: string, _factory?: MockFactory): void {}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function unmock(_moduleName: string): void {}
Loading
Loading