mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-03 06:10:20 +00:00
add basic tests, remove unused folder, make linux out dir behave like other OSes
This commit is contained in:
parent
5cc8a4b688
commit
86edff69d8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
downloaded/*.zip
|
||||
node_modules
|
||||
.DS_Store
|
||||
test/dist
|
@ -1 +0,0 @@
|
||||
downloaded atom shell zips get cached here
|
2
linux.js
2
linux.js
@ -7,7 +7,7 @@ var common = require('./common')
|
||||
|
||||
module.exports = {
|
||||
createApp: function createApp (opts, templateApp, cb) {
|
||||
var finalDir = opts.out || path.join(process.cwd(), opts.name + '-linux')
|
||||
var finalDir = path.join(opts.out || process.cwd(), opts.name + '-linux')
|
||||
var userAppDir = path.join(finalDir, 'resources', 'default_app')
|
||||
var originalBinary = path.join(finalDir, 'electron')
|
||||
var finalBinary = path.join(finalDir, opts.name)
|
||||
|
@ -29,9 +29,13 @@
|
||||
"rimraf": "^2.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"standard": "^3.3.2"
|
||||
"standard": "^3.3.2",
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard"
|
||||
"test": "standard && node test/test.js"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": ["test/dist"]
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ Allowed values: *linux, win32, darwin*
|
||||
Allowed values: *ia32, x64*
|
||||
|
||||
`version` - *String*
|
||||
Semver, see https://github.com/atom/electron/releases
|
||||
Electron version (without the 'v'). See https://github.com/atom/electron/releases
|
||||
|
||||
**Optional**
|
||||
`out` - *String*
|
||||
|
45
test/test.js
Normal file
45
test/test.js
Normal file
@ -0,0 +1,45 @@
|
||||
var test = require('tape')
|
||||
var mkdirp = require('mkdirp')
|
||||
var rimraf = require('rimraf')
|
||||
var packager = require('../index.js')
|
||||
|
||||
var distdir = __dirname + '/dist'
|
||||
rimraf.sync(distdir)
|
||||
mkdirp.sync(distdir)
|
||||
|
||||
var opts = {
|
||||
dir: __dirname + '/testapp',
|
||||
name: 'Test',
|
||||
version: '0.28.2',
|
||||
out: distdir
|
||||
}
|
||||
|
||||
test('package for windows', function (t) {
|
||||
opts.platform = 'win32'
|
||||
opts.arch = 'ia32'
|
||||
|
||||
packager(opts, function done (err, appPath) {
|
||||
t.notOk(err, 'no err')
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
||||
test('package for linux', function (t) {
|
||||
opts.platform = 'linux'
|
||||
opts.arch = 'x64'
|
||||
|
||||
packager(opts, function done (err, appPath) {
|
||||
t.notOk(err, 'no err')
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
||||
test('package for darwin', function (t) {
|
||||
opts.platform = 'darwin'
|
||||
opts.arch = 'x64'
|
||||
|
||||
packager(opts, function done (err, appPath) {
|
||||
t.notOk(err, 'no err')
|
||||
t.end()
|
||||
})
|
||||
})
|
6
test/testapp/app.js
Normal file
6
test/testapp/app.js
Normal file
@ -0,0 +1,6 @@
|
||||
var app = require('app')
|
||||
|
||||
app.on('ready', function () {
|
||||
console.log('pizza')
|
||||
app.exit()
|
||||
})
|
Loading…
Reference in New Issue
Block a user