Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fahchen committed Jan 9, 2025
1 parent 6d52ca4 commit 759239b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/subcommands/push/action/push-functions_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import createProject from "@/subcommands/admin/projects/create/action.ts";
import action from "@/subcommands/push/action.ts";
import { digest } from "@/jcli/crypto.ts";
import { join } from "path";
import { listFilesRec } from "@/jcli/file/files-man.ts";

describe("functions", () => {
let api: APIClientTest;
Expand Down Expand Up @@ -181,21 +182,35 @@ describe("functions", () => {
await api.fs.mkdir(`${FUNCTION_FILE_PATH}/users`);
await api.fs.mkdir(`${FUNCTION_FILE_PATH}/posts`);
await writeFuncFile("index.ts", "index");
console.log("-----write");
await writeFuncFile("users/mod.ts", "mod");
await writeFuncFile("posts/entry.ts", "entry");

await action(options);

console.log("inside beforeEach--------");
for await (const e of listFilesRec("./", { fs: api.fs })) {
console.log(`Found: "${e}"`);
}
await writeFuncFile("index.ts", "xedni");
await writeFuncFile("users/mod.ts", "dom");
await writeFuncFile("posts/entry.ts", "yrtne");
console.log("inside beforeEach++++++++");
for await (const e of listFilesRec("./", { fs: api.fs })) {
console.log(`Found: "${e}"`);
}

await action(options);
});

it("pushes to jet", async () => {
const func = api.jet.getFunctions(projectId)!.get(FUNCTION_NAME)!;

console.log("inside test");
for await (const e of listFilesRec("./", { fs: api.fs })) {
console.log(`Found: "${e}"`);
}

assert(func.files.hasFile(`index.ts`));
assertEquals(
await func.files.readTextFile(`index.ts`),
Expand Down Expand Up @@ -254,6 +269,7 @@ describe("functions", () => {

await action(options);

console.log("-----remove");
await api.fs.remove(`${FUNCTION_FILE_PATH}/users/mod.ts`);

await action(options);
Expand Down

0 comments on commit 759239b

Please sign in to comment.