Skip to content

Commit

Permalink
Add conditional check for GITHUB_ACTIONS in command.test.ts
Browse files Browse the repository at this point in the history
Add conditional check for GITHUB_ACTIONS to skip a test case that is not relevant when running on GitHub Actions.

Generated by gpt-3.5-turbo
  • Loading branch information
joone committed Feb 24, 2024
1 parent e422d7d commit 4fa3f0a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ describe("Linux Command Test", () => {
expect(stdout).to.include("typescript.js");
});

it("Run systemctl status apache2", function () {
let stdout = execSync(
`MOCHA_ENV=test node ${LOZ_BIN} "check if apache2 is runnig on this system"`
).toString();
expect(stdout).to.include("The Apache HTTP Server");
});
if (GITHUB_ACTIONS === false) {
it("Run systemctl status apache2", function () {
let stdout = execSync(
`MOCHA_ENV=test node ${LOZ_BIN} "check if apache2 is runnig on this system"`
).toString();
expect(stdout).to.include("The Apache HTTP Server");
});
}

// Get the system's current date and time
it("Get the system's current date and time", function () {
Expand Down

0 comments on commit 4fa3f0a

Please sign in to comment.