-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from electron-userland/tape
Run tests via tape
- Loading branch information
Showing
11 changed files
with
82 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.npmignore | ||
.travis.yml | ||
appveyor.yml | ||
test*.js | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict' | ||
|
||
const fs = require('fs') | ||
|
||
exports.verifyDownloadedZip = (t, err, zipPath) => { | ||
t.error(err, 'Error should be null') | ||
t.equal(fs.statSync(zipPath).isFile(), true, 'Zip path should exist') | ||
t.notEqual(fs.statSync(zipPath).size, 0, 'Zip path should be non-empty') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict' | ||
|
||
const download = require('..') | ||
const test = require('tape') | ||
const verifyDownloadedZip = require('./helpers').verifyDownloadedZip | ||
|
||
test('Basic test', (t) => { | ||
download({ | ||
version: '0.25.1', | ||
arch: 'ia32', | ||
platform: 'win32' | ||
}, (err, zipPath) => { | ||
verifyDownloadedZip(t, err, zipPath) | ||
t.end() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
|
||
const download = require('..') | ||
const fs = require('fs') | ||
const test = require('tape') | ||
|
||
test('404 test', (t) => { | ||
download({ | ||
version: '0.25.1', | ||
arch: 'ia32', | ||
platform: 'darwin' | ||
}, (err, zipPath) => { | ||
if (!err) t.fail('Download should throw an error') | ||
t.equal(fs.existsSync(zipPath), false, 'Zip path should not exist') | ||
t.equal(err.message, 'Failed to find Electron v0.25.1 for darwin-ia32 at https://github.com/electron/electron/releases/download/v0.25.1/electron-v0.25.1-darwin-ia32.zip', 'Error message should contain version and URL') | ||
t.end() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
|
||
const download = require('..') | ||
const test = require('tape') | ||
const verifyDownloadedZip = require('./helpers').verifyDownloadedZip | ||
|
||
test('Symbols test', (t) => { | ||
download({ | ||
version: '0.26.1', | ||
arch: 'x64', | ||
platform: 'darwin', | ||
symbols: true | ||
}, (err, zipPath) => { | ||
verifyDownloadedZip(t, err, zipPath) | ||
t.ok(/-symbols\.zip$/.test(zipPath), 'Zip path should end with -symbols.zip') | ||
t.end() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict' | ||
|
||
const download = require('..') | ||
const test = require('tape') | ||
const verifyDownloadedZip = require('./helpers').verifyDownloadedZip | ||
|
||
test('Checksum test', (t) => { | ||
download({ | ||
version: '1.3.3', | ||
arch: 'x64', | ||
platform: 'win32', | ||
symbols: true | ||
}, (err, zipPath) => { | ||
verifyDownloadedZip(t, err, zipPath) | ||
t.end() | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.