Skip to content

Commit

Permalink
Remove octokit dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlawson committed Jan 12, 2020
1 parent 4b8ef1a commit 0565181
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 71 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Checkout
uses: actions/checkout@v1

Expand All @@ -43,8 +48,7 @@ jobs:
- name: Format
run: |
npm run format
git diff
git diff --quiet
git diff --quiet src/ __tests__/
- name: Run tests
run: npm test
9 changes: 7 additions & 2 deletions __tests__/version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ describe('When a version is needed', () => {
// 3.13.5
nock('https://api.github.com')
.get('/repos/Kitware/CMake/releases')
.query({ page: 1 })
.replyWithFile(200, path.join(dataPath, 'releases.json'), {
'Content-Type': 'application/json',
Link: '<...releases?page=2>; rel="last"'
Link:
'<...releases?page=2>; rel="next", <...releases?page=2>; rel="last"'
});
// Releases file 2 contains version info for:
// 2.4.8, 2.6.4, 2.8.10.2, 2.8.12.2
Expand All @@ -27,7 +29,8 @@ describe('When a version is needed', () => {
.query({ page: 2 })
.replyWithFile(200, path.join(dataPath, 'releases2.json'), {
'Content-Type': 'application/json',
Link: '<...releases?page=2>; rel="last"'
Link:
'<...releases?page=1>; rel="prev", <...releases?page=2>; rel="last"'
});
});
afterEach(() => {
Expand Down Expand Up @@ -91,11 +94,13 @@ describe('When api token is required', () => {
}
})
.get('/repos/Kitware/CMake/releases')
.query({ page: 1 })
.replyWithFile(200, path.join(dataPath, 'releases.json'), {
'Content-Type': 'application/json'
});
nock('https://api.github.com')
.get('/repos/Kitware/CMake/releases')
.query({ page: 1 })
.replyWithError('Invalid API token');
});
afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0565181

Please sign in to comment.