generated from AnandChowdhary/node.ts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d889ae
commit 2379c2f
Showing
3 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
go to example.com | ||
take a screenshot | ||
save to example.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
import { nodeTs } from "./index"; | ||
import { puppet } from "./index"; | ||
|
||
describe("puppet", () => { | ||
it("works", () => { | ||
expect(nodeTs()).toBeTruthy(); | ||
describe("puppet basic run", () => { | ||
it("downloads and runs URL", async () => { | ||
const result = await puppet("https://pastebin.com/raw/bqRmm1z9"); | ||
expect(result).toBeUndefined(); | ||
}); | ||
it("runs array of commands", async () => { | ||
const result = await puppet([ | ||
"go to example.com", | ||
"take a screenshot", | ||
"save to example.png", | ||
]); | ||
expect(result).toBeUndefined(); | ||
}); | ||
it("runs a file path", async () => { | ||
const result = await puppet("examples/screenshot.txt"); | ||
expect(result).toBeUndefined(); | ||
}); | ||
it("throws if no commands", async () => { | ||
expect((puppet as any)()).rejects.toEqual( | ||
new Error("Argument must be a string or an array of strings") | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters