Rename folders

This commit is contained in:
Christopher Schleiden
2023-02-22 15:52:40 -08:00
parent 16cc4d9bda
commit 2a3d63551f
469 changed files with 0 additions and 0 deletions
@@ -0,0 +1,65 @@
import {ActionStep, RunStep} from "@github/actions-workflow-parser/model/workflow-template";
import {testGetWorkflowContext} from "../test-utils/test-workflow-context";
describe("getWorkflowContext", () => {
it("context for workflow", async () => {
const context = await testGetWorkflowContext(`on: push
name: te|st
jobs:
build:
runs-on: ubuntu-latest
steps:
- echo Hello`);
expect(context.uri).not.toBe("");
expect(context.template).not.toBeUndefined();
expect(context.job).toBeUndefined();
expect(context.step).toBeUndefined();
});
it("context for workflow job", async () => {
const context = await testGetWorkflowContext(`on: push
jobs:
build:
runs-on: ubuntu-lat|est
steps:
- run: echo Hello`);
expect(context.uri).not.toBe("");
expect(context.template).not.toBeUndefined();
expect(context.job).not.toBeUndefined();
expect(context.step).toBeUndefined();
});
it("context for workflow run step", async () => {
const context = await testGetWorkflowContext(`on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo |Hello
- uses: actions/checkout@v2`);
expect(context.uri).not.toBe("");
expect(context.template).not.toBeUndefined();
expect(context.job).not.toBeUndefined();
const step = context.step as RunStep;
expect(step).not.toBeUndefined();
expect(step.run.toDisplayString()).toBe("echo Hello");
});
it("context for workflow uses step", async () => {
const context = await testGetWorkflowContext(`on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo Hello
- uses: actions/checkout@v2|`);
expect(context.uri).not.toBe("");
expect(context.template).not.toBeUndefined();
expect(context.job).not.toBeUndefined();
const step = context.step as ActionStep;
expect(step).not.toBeUndefined();
expect(step.uses.value).toBe("actions/checkout@v2");
});
});