Skip to content

Commit 95af7b0

Browse files
committed
test(web-host): add e2e tests for tee plugin
1 parent d21b6c4 commit 95af7b0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

packages/web-host/tests/repl-plugins.spec.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,34 @@ test("cat README.md", async ({ page }) => {
8989
9090
You are interacting with a virtual filesystem, in your browser!`);
9191
});
92+
93+
test("tee new-file.txt", async ({ page }) => {
94+
await page.goto("/#repl");
95+
// check the file don't exist
96+
await fillAndSubmitCommand(page, "ls", {
97+
expectStdout: `D data
98+
D documents
99+
D logs
100+
F .config
101+
F .hidden_file
102+
F README.md`,
103+
});
104+
await fillAndSubmitCommand(page, "echo Some Content");
105+
await fillAndSubmitCommand(page, "tee new-file.txt", {
106+
expectStdout: "Some Content",
107+
});
108+
await fillAndSubmitCommand(page, "cat new-file.txt", {
109+
expectStdout: "Some Content",
110+
});
111+
});
112+
113+
test("tee README.md", async ({ page }) => {
114+
await page.goto("/#repl");
115+
await fillAndSubmitCommand(page, "echo Some Content");
116+
await fillAndSubmitCommand(page, "tee README.md", {
117+
expectStdout: "Some Content",
118+
});
119+
await fillAndSubmitCommand(page, "cat README.md", {
120+
expectStdout: "Some Content",
121+
});
122+
});

0 commit comments

Comments
 (0)