Skip to content

Commit

Permalink
test(cli): initial
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnpma committed Apr 7, 2015
1 parent 4bb7474 commit c88befc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var resize = require('./')
var fs = require('fs')
var rimraf = require('rimraf')
var mkdirp = require('mkdirp')
var pkg = require('./package.json')
var exec = require('child_process').exec

test('creates all icons in tmp directory', function (t) {
t.plan(13)
Expand All @@ -27,3 +29,26 @@ test('creates all icons in tmp directory', function (t) {
})
})
})

test('cli creates all icons in tmp directory', function (t) {
t.plan(13)
rimraf('tmp', function () {
mkdirp('tmp', function () {
exec(pkg.bin + ' --input test/com.appbusinesspodcast.www.png --output tmp', function () {
t.ok(fs.existsSync('tmp/splash-port-hdpi.png'), 'splash-port-hdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-port-mdpi.png'), 'splash-port-mdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-port-ldpi.png'), 'splash-port-ldpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-port-xhdpi.png'), 'splash-port-xhdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-port-xxhdpi.png'), 'splash-port-xxhdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-port-xxxhdpi.png'), 'splash-port-xxxhdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-land-hdpi.png'), 'splash-land-hdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-land-mdpi.png'), 'splash-land-mdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-land-ldpi.png'), 'splash-land-ldpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-land-xhdpi.png'), 'splash-land-xhdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-land-xxhdpi.png'), 'splash-land-xxhdpi.png' + ' created')
t.ok(fs.existsSync('tmp/splash-land-xxxhdpi.png'), 'splash-land-xxxhdpi.png' + ' created')
t.ok(fs.existsSync('tmp/GooglePlayFeature.png'), 'GooglePlayFeature.png' + ' created')
})
})
})
})

0 comments on commit c88befc

Please sign in to comment.