Skip to content

Commit df520c2

Browse files
run_function_when_infra_running
1 parent 3c63f01 commit df520c2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

composables/runFunctionIfCloudRunning.js renamed to composables/run_function_when_infra_running.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default async function (function_to_run) {
1+
export function run_function_when_infra_running(function_to_run) {
22
const infra_store = use_infra_store()
33
const { is_running } = storeToRefs(infra_store)
44
if (is_running.value) {
@@ -11,3 +11,6 @@ export default async function (function_to_run) {
1111
})
1212
}
1313
}
14+
15+
16+
export default run_function_when_infra_running

test/composables/runFunctionIfCloudRunning.nuxt.test.js renamed to test/composables/run_function_when_infra_running.nuxt.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, test, beforeEach, vi } from "vitest"
22

3-
describe("api_fetch.js", () => {
3+
describe("run_function_when_infra_running", () => {
44
const geode_store = use_geode_store()
55
const viewer_store = use_viewer_store()
66

@@ -16,13 +16,13 @@ describe("api_fetch.js", () => {
1616
await geode_store.$patch({ is_running: true })
1717
await viewer_store.$patch({ is_running: true })
1818

19-
await runFunctionIfCloudRunning(dumb_obj.dumb_method)
19+
await run_function_when_infra_running(dumb_obj.dumb_method)
2020
expect(spy).toHaveBeenCalled()
2121
})
2222

2323
test("is_running false", async () => {
2424
const spy = vi.spyOn(dumb_obj, "dumb_method")
25-
runFunctionIfCloudRunning(dumb_obj.dumb_method)
25+
run_function_when_infra_running(dumb_obj.dumb_method)
2626
await geode_store.$patch({ is_running: true })
2727
await viewer_store.$patch({ is_running: true })
2828
expect(spy).toHaveBeenCalled()

0 commit comments

Comments
 (0)