Skip to content

Commit

Permalink
Upgrade dependencies (#9)
Browse files Browse the repository at this point in the history
* Fix lint errors
* Update `ava` throws assertions
  • Loading branch information
malept authored Dec 26, 2018
1 parent accd157 commit 78a145f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@
"linux"
],
"devDependencies": {
"ava": "^0.25.0",
"codecov": "^3.0.0",
"ava": "^1.0.1",
"codecov": "^3.1.0",
"cross-env": "^5.2.0",
"eslint": "^4.7.2",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-ava": "^4.4.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"nyc": "^11.4.1"
"eslint": "^5.11.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-ava": "^5.1.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"nyc": "^13.1.0"
},
"dependencies": {
"asar": "^0.14.0",
"asar": "^0.14.6",
"cross-spawn-promise": "^0.10.1",
"debug": "^3.0.1",
"debug": "^4.1.1",
"electron-installer-common": "^0.3.0",
"fs-extra": "^5.0.0",
"js-yaml": "^3.10.0",
Expand All @@ -53,10 +53,10 @@
"lodash.pull": "^4.1.0",
"lodash.template": "^4.4.0",
"nodeify": "^1.0.1",
"pify": "^3.0.0",
"pify": "^4.0.1",
"tmp-promise": "^1.0.3",
"which": "^1.3.0",
"yargs": "^11.0.0"
"yargs": "^12.0.5"
},
"engines": {
"node": ">= 6.0"
Expand Down
2 changes: 1 addition & 1 deletion test/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const test = require('ava')
require('./_util')

test('copyHooks fails with an invalid script', t =>
t.throws(copyHooks(t.context.tempDir.name, { hookScripts: { install: '/does/not/exist' } }), /Hook install at .* does not exist/)
t.throwsAsync(copyHooks(t.context.tempDir.name, { hookScripts: { install: '/does/not/exist' } }), /Hook install at .* does not exist/)
)

test('copyHooks installs a hook script', t => {
Expand Down
10 changes: 5 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ const util = require('./_util')

test('missing configuration', t => t.throws(snap, 'Missing configuration'))

test('package description too long', t => t.throws(snap({src: path.join(__dirname, 'fixtures', 'description-too-long')}), /The max length of the summary/))
test('package description too long', t => t.throwsAsync(snap({ src: path.join(__dirname, 'fixtures', 'description-too-long') }), /The max length of the summary/))

test('packaged app not found', t => t.throws(snap({}), /Could not find, read, or parse package\.json/))
test('packaged app not found', t => t.throwsAsync(snap({}), /Could not find, read, or parse package\.json/))

test('cannot find custom snapcraft', t => t.throws(snap({src: path.join(__dirname, 'fixtures', 'app-with-asar'), snapcraft: '/foo/bar/non-existent'}), /Cannot locate \/foo\/bar\/non-existent in your system/))
test('cannot find custom snapcraft', t => t.throwsAsync(snap({ src: path.join(__dirname, 'fixtures', 'app-with-asar'), snapcraft: '/foo/bar/non-existent' }), /Cannot locate \/foo\/bar\/non-existent in your system/))

if (!process.env['FAST_TESTS_ONLY']) {
test.serial('creates a snap', t => {
let snapPath
return snap({src: path.join(__dirname, 'fixtures', 'app-with-asar')})
return snap({ src: path.join(__dirname, 'fixtures', 'app-with-asar') })
.then(path => {
t.truthy(path, 'snap returns a truthy value')
snapPath = path
Expand All @@ -44,7 +44,7 @@ if (!process.env['FAST_TESTS_ONLY']) {
let snapPath
const destDir = path.join(t.context.tempDir.name, 'custom-output-directory')
return fs.mkdirs(destDir)
.then(() => snap({src: path.join(__dirname, 'fixtures', 'app-with-asar'), dest: destDir}))
.then(() => snap({ src: path.join(__dirname, 'fixtures', 'app-with-asar'), dest: destDir }))
.then(path => {
t.truthy(path, 'snap returns a truthy value')
snapPath = path
Expand Down
6 changes: 3 additions & 3 deletions test/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ const test = require('ava')
require('./_util')

test('desktop-launch command uses productName by default', t => {
const command = launcher.createDesktopLaunchCommand({name: 'app-name', productName: 'App Name'})
const command = launcher.createDesktopLaunchCommand({ name: 'app-name', productName: 'App Name' })
t.true(command.startsWith('desktop-launch'), 'Command uses desktop-launch')
t.true(command.endsWith("/App Name'"), 'Command uses exe-name')
})

test('desktop-launch command uses executableName if specified', t => {
const command = launcher.createDesktopLaunchCommand({name: 'app-name', productName: 'App Name', executableName: 'exe-name'})
const command = launcher.createDesktopLaunchCommand({ name: 'app-name', productName: 'App Name', executableName: 'exe-name' })
t.true(command.startsWith('desktop-launch'), 'Command uses desktop-launch')
t.true(command.endsWith("/exe-name'"), 'Command uses exe-name')
})

test('launcher is classic launcher in classic confinement', t => {
const command = launcher.createDesktopLaunchCommand({productName: 'App Name', confinement: 'classic'})
const command = launcher.createDesktopLaunchCommand({ productName: 'App Name', confinement: 'classic' })
t.true(command.startsWith('bin/electron-launch'), 'Command uses electron-launch')
})

Expand Down
2 changes: 1 addition & 1 deletion test/snapcraft.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('translate node arches to snap arches', t => {

test('generateArgs flags and options', t => {
const snapcraft = new Snapcraft()
const args = snapcraft.generateArgs('nonexistent', {a: 1, b: null}, ['foo', 'bar'])
const args = snapcraft.generateArgs('nonexistent', { a: 1, b: null }, ['foo', 'bar'])

t.deepEqual(args, ['nonexistent', '--a=1', '--b', 'foo', 'bar'], 'generated args')
})

0 comments on commit 78a145f

Please sign in to comment.