docs: Update to v5 #110
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Tests (Integration)" | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| env: | |
| dist-path: "dist" | |
| jobs: | |
| upload-dist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: "package.json" | |
| - name: Install Javascript dependencies with npm | |
| if: ${{ github.ref != 'refs/heads/release' }} | |
| run: npm install | |
| - name: Package action for integration tests | |
| if: ${{ github.ref != 'refs/heads/release' }} | |
| run: npm run package | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| test-local-assertion: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Expect two equal values to pass an equality test | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "Hello, World!" | |
| expected: "Hello, World!" | |
| - name: Expect two different values not to pass an equality test | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "Bye bye!" | |
| expected: "Goodbye, World!" | |
| - name: Expect many values to each pass an equality test | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: | | |
| Hello, World! | |
| Hello, World! | |
| Hello, World! | |
| expected: "Hello, World!" | |
| each: true | |
| test-type-based-assertion: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Expect value to be tested as type | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-even | |
| actual: 2 | |
| type: number | |
| test-default-null: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Test `expected` and `actual` are both null when not provided | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-null | |
| - name: Test `expected` and `actual` are both null when provided with conversion enabled | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-null | |
| expected: "" | |
| actual: "" | |
| convert-empty-to-null: true | |
| - name: Test empty values are default when convert empty to null is disabled | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| convert-empty-to-null: false | |
| - name: Test empty values are accepted when convert empty to null is disabled | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| expected: "" | |
| actual: "" | |
| convert-empty-to-null: false | |
| test-npm-assertion: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Expect two equal values to pass an equality test using an assertion from npm | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| actual: "Hello, World!" | |
| expected: "Hello, World!" | |
| test-readme-example: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Generate SemVer aliases with prefix | |
| id: prefixed | |
| uses: prompt/actions-semver-aliases@v1 | |
| with: | |
| version: "3.14.1" | |
| prefix: "v" | |
| major: true | |
| minor: false | |
| - name: Assert alias is prefixed | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/starts-with | |
| each: true | |
| actual: "${{ steps.prefixed.outputs.list }}" | |
| expected: "v" | |
| test-outputs: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - id: equal-strings | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "Hello, World!" | |
| expected: "Hello, World!" | |
| - name: Test `message` output is set from Result `message` | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "${{ steps.equal-strings.outputs.message }}" | |
| expected: "compared Hello, World! to Hello, World!" | |
| - name: Test `pass` output is set from Result `pass` | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-true:v1 | |
| actual: "${{ steps.equal-strings.outputs.pass }}" | |
| - name: Test `passed` has the same value as `pass` | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| expected: "${{ steps.equal-strings.outputs.pass }}" | |
| actual: "${{ steps.equal-strings.outputs.passed }}" | |
| - id: unequal-strings | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| expected: "Hello, World!" | |
| actual: "Goodbye, World!" | |
| - name: Test `failed` is true when assertion did not pass | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-true:v1 | |
| actual: ${{ steps.unequal-strings.outputs.failed }} | |
| - name: Test `passed` is false when assertion did not pass | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| actual: ${{ steps.unequal-strings.outputs.passed }} | |
| expected: "false" | |
| test-npm-versions: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - id: no-version | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/test-fixture | |
| expected: "a" | |
| actual: "a" | |
| - name: Test npm assertion without version defaults to v1 | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| actual: ${{ steps.no-version.outputs.message }} | |
| expected: "v1 compared a to a" | |
| - id: major-version | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/test-fixture:v2 | |
| expected: "a" | |
| actual: "a" | |
| - name: Test npm assertion with major version uses correct version | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| actual: ${{ steps.major-version.outputs.message }} | |
| expected: "v2 compared a to a" | |
| - id: minor-version | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/test-fixture:v2.4 | |
| expected: "a" | |
| actual: "a" | |
| - name: Test npm assertion with minor version uses correct version | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| actual: ${{ steps.minor-version.outputs.message }} | |
| expected: "v2 compared a to a" | |
| - id: unprefixed-version | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/test-fixture:0 | |
| expected: "a" | |
| actual: "a" | |
| - name: Test npm assertion with unprefixed version uses correct version | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal | |
| actual: ${{ steps.unprefixed-version.outputs.message }} | |
| expected: "v0 compared a to a" | |
| test-aggregated-assertions: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Perform multiple assertions that should aggregate to failed | |
| id: multiple-failed | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| actual: | | |
| Hello, World! | |
| Goodbye, World! | |
| Hello, World! | |
| expected: Hello, World! | |
| each: true | |
| - name: Test `pass` is not true when one test of many does not pass | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| expected: "false" | |
| actual: "${{ steps.multiple-failed.outputs.passed }}" | |
| - name: Perform multiple assertions that should aggregate to passed | |
| id: multiple-passed | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| actual: | | |
| Hello, World! | |
| Hello, World! | |
| Hello, World! | |
| expected: Hello, World! | |
| each: true | |
| - name: Test `passed` is true when all tests passed | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-true:v1 | |
| actual: "${{ steps.multiple-passed.outputs.passed }}" | |
| - name: Test multiple result messages are aggregated on pass | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| expected: | | |
| compared Hello, World! to Hello, World! | |
| compared Hello, World! to Hello, World! | |
| compared Hello, World! to Hello, World! | |
| actual: "${{ steps.multiple-passed.outputs.message }}" | |
| - name: Test multiple result messages are aggregated on fail | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| expected: | | |
| compared Hello, World! to Hello, World! | |
| compared Goodbye, World! to Hello, World! | |
| compared Hello, World! to Hello, World! | |
| actual: "${{ steps.multiple-failed.outputs.message }}" | |
| test-step-fails: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Expect two different values not to pass an equality test | |
| id: failed | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "Bye bye!" | |
| expected: "Goodbye, World!" | |
| - name: Test step fails when assertion does not pass | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| expected: "failure" | |
| actual: "${{ steps.failed.outcome }}" | |
| - name: Test failed step does not have error when error on fail is disabled | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "Bye bye!" | |
| expected: "Goodbye, World!" | |
| error-on-fail: false | |
| test-error-message: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - upload-dist | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: ${{ env.dist-path }} | |
| - name: Perform failing assertion with custom Error Message | |
| id: with-error-message | |
| continue-on-error: true | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "Bye bye!" | |
| expected: "Goodbye, World!" | |
| error-message: "The two different strings are not equal" | |
| - name: Test custom Error Message is used | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| expected: "The two different strings are not equal" | |
| actual: "${{ steps.with-error-message.outputs.error }}" | |
| - name: Perform failing assertion without custom Error Message | |
| id: without-error-message | |
| continue-on-error: true | |
| uses: ./ | |
| with: | |
| assertion: local://.github/workflows/assertions/is-equal | |
| actual: "Bye bye!" | |
| expected: "Goodbye, World!" | |
| - name: Test assertion message is used as default error | |
| uses: ./ | |
| with: | |
| assertion: npm://@assertions/is-equal:v1 | |
| expected: "compared Bye bye! to Goodbye, World!" | |
| actual: "${{ steps.without-error-message.outputs.error }}" |