mirror of
https://github.com/mshick/add-pr-comment.git
synced 2025-12-31 14:20:32 +11:00
23 lines
773 B
JavaScript
23 lines
773 B
JavaScript
// const wait = require("./wait");
|
|
const process = require("process");
|
|
const cp = require("child_process");
|
|
const path = require("path");
|
|
|
|
// test("throws invalid number", async () => {
|
|
// await expect(wait("foo")).rejects.toThrow("milleseconds not a number");
|
|
// });
|
|
|
|
// test("wait 500 ms", async () => {
|
|
// const start = new Date();
|
|
// await wait(500);
|
|
// const end = new Date();
|
|
// var delta = Math.abs(end - start);
|
|
// expect(delta).toBeGreaterThan(450);
|
|
// });
|
|
|
|
// shows how the runner will run a javascript action with env / stdout protocol
|
|
test("test runs", () => {
|
|
const env = { INPUT_MSG: "Hello world!", INPUT_GITHUB_TOKEN: "abc123" };
|
|
const ip = path.join(__dirname, "index.js");
|
|
console.log(cp.execSync(`node ${ip}`, { env }).toString());
|
|
});
|