Skip to content

Commit

Permalink
standardize (electron#220)
Browse files Browse the repository at this point in the history
* standardize

* oops we are still supporting node 4

* no mocha magic globals
  • Loading branch information
zeke authored Jul 9, 2017
1 parent 6950fc5 commit d9b3042
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ require('dotenv-safe').load()

const Github = require('github')
const github = new Github({

})

github.authenticate({
type: 'token',
token: process.env.GITHUB_AUTH_TOKEN
type: 'token',
token: process.env.GITHUB_AUTH_TOKEN
})

module.exports = github
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"build:colors": "node script/colors",
"build:releases": "node script/releases",
"build:pack": "node script/pack",
"test": "mocha --reporter min test/human-data.js",
"test-all": "mocha --reporter min",
"test": "mocha --reporter min test/human-data.js && standard --fix",
"test-all": "mocha --reporter min && standard --fix",
"wizard": "node wizard.js",
"release": "script/release.sh"
},
Expand Down Expand Up @@ -44,9 +44,10 @@
"rimraf": "^2.6.1",
"sharp": "^0.17.0",
"slugg": "^1.1.0",
"standard": "^10.0.2",
"yamljs": "^0.2.8"
},
"engines": {
"node": ">=6"
"node": ">=4"
}
}
5 changes: 2 additions & 3 deletions script/dates.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fs = require('fs')
const path = require('path')
const yaml = require('yamljs')
const execSync = require('child_process').execSync
const datesPath = path.join(__dirname, '../meta/dates.json')
const dates = require(datesPath)
Expand All @@ -10,10 +9,10 @@ const apps = require('../lib/raw-app-list')()
console.log('Checking app submission dates...')

apps
.filter(app => existingSlugs.indexOf(app.slug) === -1 )
.filter(app => existingSlugs.indexOf(app.slug) === -1)
.forEach(app => {
// https://git-scm.com/docs/pretty-formats
cmd = `git log -S "${app.website}" --pretty=format:'%ci' | tail -n1`
const cmd = `git log -S "${app.website}" --pretty=format:'%ci' | tail -n1`
const date = String(execSync(cmd)).slice(0, 10)
console.log(`${app.slug}: ${date}`)
dates[app.slug] = date
Expand Down
2 changes: 1 addition & 1 deletion script/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fs.readdirSync(path.join(__dirname, '../apps'))
)

if (!app.releases) app.releases = []

apps.push(app)
})

Expand Down
7 changes: 5 additions & 2 deletions test/human-data.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const mocha = require('mocha')
const describe = mocha.describe
const it = mocha.it
const fs = require('fs')
const path = require('path')
const expect = require('chai').expect
Expand Down Expand Up @@ -35,11 +38,11 @@ describe('human-submitted app data', () => {
const app = yaml.load(yamlPath)

it('has a name', () => {
expect(app.name).to.not.be.empty
expect(app.name.length).to.be.above(0)
})

it('has a description', () => {
expect(app.description).to.not.be.empty
expect(app.description.length).to.be.above(0)
})

it('has a website with a valid URL', () => {
Expand Down
4 changes: 3 additions & 1 deletion test/machine-data.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const mocha = require('mocha')
const describe = mocha.describe
const it = mocha.it
const fs = require('fs')
const path = require('path')
const apps = require('..')
const expect = require('chai').expect

describe('machine-generated app data (exported by the module)', () => {

it('is an array', () => {
expect(apps).to.be.an('array')
})
Expand Down

0 comments on commit d9b3042

Please sign in to comment.