This repository has been archived by the owner on Mar 4, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create test stub, add CI workflow file, add test badge
- Loading branch information
Showing
4 changed files
with
53 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Tests" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all | ||
- master # triggers on pushes that contain changes in master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- run: npm ci | ||
- run: npm test |
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
jest.mock('@actions/github'); | ||
|
||
const { GitHub, context } = require('@actions/github'); | ||
const run = require('../src/main.js'); | ||
|
||
/* eslint-disable no-undef */ | ||
describe('module', () => { | ||
let uploadReleaseAsset; | ||
|
||
beforeEach(() => { | ||
uploadReleaseAsset = jest.fn(); | ||
|
||
context.repo = { | ||
owner: 'owner', | ||
repo: 'repo' | ||
}; | ||
|
||
const github = { | ||
repos: { | ||
uploadReleaseAsset | ||
} | ||
}; | ||
|
||
GitHub.mockImplementation(() => github); | ||
}); | ||
|
||
test('Upload release endpoint is called', async () => { | ||
await run(); | ||
|
||
expect(uploadReleaseAsset).toHaveBeenCalledWith({ | ||
owner: 'owner', | ||
repo: 'repo' | ||
}); | ||
}); | ||
|
||
test('Outputs are set', async () => {}); | ||
}); |