test: remove repeated update module imports
This commit is contained in:
parent
df76e0f44b
commit
f2107a53cb
@ -20,6 +20,8 @@ vi.mock("./bundled-sources.js", () => ({
|
||||
resolveBundledPluginSources: (...args: unknown[]) => resolveBundledPluginSourcesMock(...args),
|
||||
}));
|
||||
|
||||
const { syncPluginsForUpdateChannel, updateNpmInstalledPlugins } = await import("./update.js");
|
||||
|
||||
describe("updateNpmInstalledPlugins", () => {
|
||||
beforeEach(() => {
|
||||
installPluginFromNpmSpecMock.mockReset();
|
||||
@ -36,7 +38,6 @@ describe("updateNpmInstalledPlugins", () => {
|
||||
extensions: ["index.ts"],
|
||||
});
|
||||
|
||||
const { updateNpmInstalledPlugins } = await import("./update.js");
|
||||
await updateNpmInstalledPlugins({
|
||||
config: {
|
||||
plugins: {
|
||||
@ -71,7 +72,6 @@ describe("updateNpmInstalledPlugins", () => {
|
||||
extensions: ["index.ts"],
|
||||
});
|
||||
|
||||
const { updateNpmInstalledPlugins } = await import("./update.js");
|
||||
await updateNpmInstalledPlugins({
|
||||
config: {
|
||||
plugins: {
|
||||
@ -104,7 +104,6 @@ describe("updateNpmInstalledPlugins", () => {
|
||||
error: "Package not found on npm: @openclaw/missing.",
|
||||
});
|
||||
|
||||
const { updateNpmInstalledPlugins } = await import("./update.js");
|
||||
const result = await updateNpmInstalledPlugins({
|
||||
config: {
|
||||
plugins: {
|
||||
@ -137,7 +136,6 @@ describe("updateNpmInstalledPlugins", () => {
|
||||
error: "unsupported npm spec: github:evil/evil",
|
||||
});
|
||||
|
||||
const { updateNpmInstalledPlugins } = await import("./update.js");
|
||||
const result = await updateNpmInstalledPlugins({
|
||||
config: {
|
||||
plugins: {
|
||||
@ -172,7 +170,6 @@ describe("updateNpmInstalledPlugins", () => {
|
||||
extensions: ["index.ts"],
|
||||
});
|
||||
|
||||
const { updateNpmInstalledPlugins } = await import("./update.js");
|
||||
const result = await updateNpmInstalledPlugins({
|
||||
config: {
|
||||
plugins: {
|
||||
@ -231,7 +228,6 @@ describe("updateNpmInstalledPlugins", () => {
|
||||
marketplacePlugin: "claude-bundle",
|
||||
});
|
||||
|
||||
const { updateNpmInstalledPlugins } = await import("./update.js");
|
||||
const result = await updateNpmInstalledPlugins({
|
||||
config: {
|
||||
plugins: {
|
||||
@ -280,7 +276,6 @@ describe("updateNpmInstalledPlugins", () => {
|
||||
marketplacePlugin: "claude-bundle",
|
||||
});
|
||||
|
||||
const { updateNpmInstalledPlugins } = await import("./update.js");
|
||||
const result = await updateNpmInstalledPlugins({
|
||||
config: {
|
||||
plugins: {
|
||||
@ -330,7 +325,6 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
]),
|
||||
);
|
||||
|
||||
const { syncPluginsForUpdateChannel } = await import("./update.js");
|
||||
const result = await syncPluginsForUpdateChannel({
|
||||
channel: "beta",
|
||||
config: {
|
||||
@ -369,7 +363,6 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
]),
|
||||
);
|
||||
|
||||
const { syncPluginsForUpdateChannel } = await import("./update.js");
|
||||
const result = await syncPluginsForUpdateChannel({
|
||||
channel: "beta",
|
||||
config: {
|
||||
@ -402,7 +395,6 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
resolveBundledPluginSourcesMock.mockReturnValue(new Map());
|
||||
const env = { OPENCLAW_HOME: "/srv/openclaw-home" } as NodeJS.ProcessEnv;
|
||||
|
||||
const { syncPluginsForUpdateChannel } = await import("./update.js");
|
||||
await syncPluginsForUpdateChannel({
|
||||
channel: "beta",
|
||||
config: {},
|
||||
@ -434,7 +426,6 @@ describe("syncPluginsForUpdateChannel", () => {
|
||||
const previousHome = process.env.HOME;
|
||||
process.env.HOME = "/tmp/process-home";
|
||||
try {
|
||||
const { syncPluginsForUpdateChannel } = await import("./update.js");
|
||||
const result = await syncPluginsForUpdateChannel({
|
||||
channel: "beta",
|
||||
env: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user