Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI #12

Merged
merged 4 commits into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
sudo: false

node_js:
- "10"
- "12"
- "14"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: sort the newest at the top

Suggested change
- "10"
- "12"
- "14"
- "14"
- "12"
- "10"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 5b5e684, but for the record I find this change entirely pointless.

Nits like this are distracting, discouraging and demotivating.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry I caused you to feel this way; I'd love to understand more about why it's discouraging or demotivating. To me, this is just part of any code review. It being a "nit" just means it's not a blocker, and i'd be happy to explain why it's not pointless if you're interested.

Copy link
Member Author

@dominykas dominykas Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation for the ordering probably matters more on nodejs/ci-config-travis#6 than here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In an imported config, the order is backwards; so i believe it's correct there :-)


cache:
npm: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the default, fwiw, so this line isn't needed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@ljharb ljharb Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently i'm wrong as of a year ago :-) "Please note that as of July 2019, npm is cached by default on Travis CI" my mistake.


16 changes: 9 additions & 7 deletions test/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ const tap = require('tap')
const github = require('../lib/github')
const CONFIG = require('./fixtures/config')

tap.test('package.json can be fetched with a valid url', async tap => {
tap.equal(JSON.stringify(await github.getPackageJson(CONFIG.DEP_ORG, CONFIG.DEP_REPO)), JSON.stringify(CONFIG.PKGJSON))
// tap.throws( await pkgTest.getPackageJson('not-an-org', 'not-a-repo'))
})
if (process.env.GITHUB_TOKEN) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does tap not have a "skip" mechanism?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My google led me to issues for jest, not tap 🤦 0d5460d

tap.test('package.json can be fetched with a valid url', async tap => {
tap.equal(JSON.stringify(await github.getPackageJson(CONFIG.DEP_ORG, CONFIG.DEP_REPO)), JSON.stringify(CONFIG.PKGJSON))
// tap.throws( await pkgTest.getPackageJson('not-an-org', 'not-a-repo'))
})

tap.test('correct permissions returned for GitHub repo', async tap => {
tap.equal((await github.getPermissions(CONFIG.DEP_ORG, CONFIG.DEP_REPO)), CONFIG.DEP_REPO_PERM)
})
tap.test('correct permissions returned for GitHub repo', async tap => {
tap.equal((await github.getPermissions(CONFIG.DEP_ORG, CONFIG.DEP_REPO)), CONFIG.DEP_REPO_PERM)
})
}