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

💪 Use Entrypoint style in test code #347

Merged
merged 1 commit into from
May 14, 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
6 changes: 3 additions & 3 deletions denops/@denops-private/testdata/dummy_invalid_plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Denops } from "https://deno.land/x/denops_core@v6.0.5/mod.ts";
import type { Entrypoint } from "https://deno.land/x/denops_core@v6.1.0/mod.ts";

export function main(_denops: Denops): Promise<void> {
export const main: Entrypoint = (_denops) => {
throw new Error("This is dummy error");
}
};
6 changes: 3 additions & 3 deletions denops/@denops-private/testdata/dummy_valid_plugin.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Denops } from "https://deno.land/x/denops_core@v6.0.5/mod.ts";
import type { Entrypoint } from "https://deno.land/x/denops_core@v6.1.0/mod.ts";

export async function main(denops: Denops): Promise<void> {
export const main: Entrypoint = async (denops) => {
denops.dispatcher = {
test: async (...args) => {
await denops.cmd(`echo 'This is test call: ${JSON.stringify(args)}'`);
},
};
await denops.cmd("echo 'Hello, Denops!'");
}
};