-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Image link checker * handle modules correctly * simplify * Add tests * run tests as part of build * move to test folder * Test passed file paths * Use Jest in MJS mode * Allow passing a list of files to test * try with mocha and chai * run tests on PRs * use updated action * Run on only md and mdx files * try this way * add check on files content * This seems to work with top-level await * no need to run twice * try with this PR setting * correct paths * remove logging message * can I skip these steps? * try adding a reporter * continue on error so the reporter can do its job * debug why test report file is not available * upload artifact * This didn't work This reverts commit 3722bfe. * try with quoted path * Restore files that I changed to get errors * Note about testing in readme
- Loading branch information
1 parent
9936653
commit 541f6ff
Showing
8 changed files
with
1,548 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
|
||
checkChangedFiles: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
files: ${{ steps.files.outputs.added_modified }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: files | ||
uses: Ana06/[email protected] | ||
with: | ||
format: 'csv' | ||
filter: '*.mdx?' | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: checkChangedFiles | ||
if: ${{ needs.checkChangedFiles.outputs.files != '' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
- run: npm run test -- --reporter JSON --reporter-option output=mocha.json --filesToCheck=${{ needs.checkChangedFiles.outputs.files }} | ||
continue-on-error: true | ||
- run: ls | ||
- uses: dorny/test-reporter@v1 | ||
with: | ||
name: Mocha tests | ||
path: 'mocha.json' | ||
reporter: mocha-json |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ node_modules | |
out | ||
build | ||
|
||
filesToTest.txt | ||
|
This file contains 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
Oops, something went wrong.