35 lines
780 B
JavaScript
35 lines
780 B
JavaScript
const setup = require("./utilities")
|
|
|
|
describe("test the bash action", () => {
|
|
let config = setup.getConfig()
|
|
|
|
beforeEach(async () => {
|
|
await config.init()
|
|
})
|
|
afterAll(setup.afterAll)
|
|
|
|
it("should be able to execute a script", async () => {
|
|
|
|
let res = await setup.runStep("EXECUTE_BASH",
|
|
inputs = {
|
|
code: "echo 'test'"
|
|
}
|
|
|
|
)
|
|
expect(res.stdout).toEqual("test\n")
|
|
expect(res.success).toEqual(true)
|
|
})
|
|
|
|
it("should handle a null value", async () => {
|
|
|
|
let res = await setup.runStep("EXECUTE_BASH",
|
|
inputs = {
|
|
code: null
|
|
}
|
|
|
|
|
|
)
|
|
expect(res.stdout).toEqual("Budibase bash automation failed: Invalid inputs")
|
|
})
|
|
})
|