Skip to content

Commit

Permalink
tests: added test matrix to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz-pluszczewski committed Jan 3, 2025
1 parent c7aa0f2 commit 8e2ba22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/verify-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ jobs:
run: lac --default-config




test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 18, 20, 22 ]
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
needs: format-and-lint
steps:
- name: Check out code
Expand All @@ -60,7 +62,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: ${{ matrix.node }}

- name: Install dependencies
run: npm ci
Expand All @@ -72,10 +74,7 @@ jobs:
run: npm run test:coverage

- name: Run e2e tests
run: npm run test:e2e

- name: Run snapshot tests
run: npm run test:snapshot
run: npm run test:e2e --prefix=test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
2 changes: 1 addition & 1 deletion test/test/yarn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from "node:fs/promises";
import * as path from "node:path";
import type { JsonResults } from "@license-auditor/data";
import { describe, expect } from "vitest";
import { yarnFixture, yarnWithInvalidGithubDepFixture } from "../fixtures";
import { yarnFixture } from "../fixtures";
import { addToPackageJson } from "../utils/add-to-package-json";
import { getCliPath } from "../utils/get-cli-path";
import { readJsonFile } from "../utils/read-json-file";
Expand Down
2 changes: 1 addition & 1 deletion test/utils/run-cli-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function runCliCommand(command: CliCommand) {
});

cli.onExit((code) => {
resolve({ output: output.join("\n"), errorCode: code.exitCode });
resolve({ output: output.join(''), errorCode: code.exitCode });
});
} catch (error) {
reject(error);
Expand Down

0 comments on commit 8e2ba22

Please sign in to comment.