Skip to content

Commit

Permalink
ci: add tests and workflow (#9)
Browse files Browse the repository at this point in the history
This adds a simple unit test to help with merging in dependabot updates
mostly, as well as a CI workflow to run them.
  • Loading branch information
vacas5 authored Jun 13, 2024
1 parent 98d89dc commit 2552eae
Show file tree
Hide file tree
Showing 6 changed files with 4,647 additions and 26 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Tests
env:
UNSPLASH_APP_ID: ${{ secrets.UNSPLASH }}
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"arrowParens": "avoid",
"singleQuote": true
}
8 changes: 4 additions & 4 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ exports.sourceNodes = ({ actions }, { appId, collections, perPage = 10 }) => {
.get(`https://api.unsplash.com/collections/${collection}/photos`, {
params: {
client_id: appId,
per_page: perPage
}
per_page: perPage,
},
})
.then(res => {
res.data.map(photo => {
Expand All @@ -26,8 +26,8 @@ exports.sourceNodes = ({ actions }, { appId, collections, perPage = 10 }) => {
internal: {
type: 'UnsplashPhoto',
contentDigest: digest,
mediaType: 'application/json'
}
mediaType: 'application/json',
},
});

createNode(node);
Expand Down
Loading

0 comments on commit 2552eae

Please sign in to comment.