Skip to content

Commit

Permalink
test: add a workflow which submits a mock test result
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwremmel committed Feb 17, 2020
1 parent c85ab3e commit ed5e7a2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on: push
name: Example
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: |
mkdir -p ./reports/junit/
cp ./example/junit.xml ./reports/junit/
# I can't find a way to make the branch name below dynamic, so we'l
# need to remember to adjust it when working on features.
- uses: check-run-reporter/action@master
env:
CHECK_RUN_REPORTER_LABEL: 'Unit Tests'
CHECK_RUN_REPORTER_REPORT: 'reports/junit/**/*.xml'
CHECK_RUN_REPORTER_TOKEN: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }}
5 changes: 5 additions & 0 deletions example/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('example', () => {
it('does not fail', () => {
expect(false).toBe(true);
});
});
17 changes: 17 additions & 0 deletions example/junit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Unit Tests" tests="1" failures="1" time="1.3">
<testsuite name="example" errors="0" failures="1" skipped="0" timestamp="2020-02-17T01:23:12" time="0.641" tests="1">
<testcase classname="example" name="does not fail" time="0.003">
<failure>Error: expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false
at Object.&lt;anonymous&gt; (/github/workspace/example/index.spec.js:3:19)
at Object.asyncJestTest (/github/workspace/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:102:37)
at /github/workspace/node_modules/jest-jasmine2/build/queueRunner.js:43:12
at new Promise (&lt;anonymous&gt;)
at mapper (/github/workspace/node_modules/jest-jasmine2/build/queueRunner.js:26:19)
at /github/workspace/node_modules/jest-jasmine2/build/queueRunner.js:73:41</failure>
</testcase>
</testsuite>
</testsuites>

0 comments on commit ed5e7a2

Please sign in to comment.