Skip to content

Commit

Permalink
Fixes tests for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
wgester committed May 27, 2015
1 parent 92fbc75 commit e33283f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@ node_js:
- '0.10'
- iojs
sudo: false
before_script: node './spec/setup.js'
notifications:
email:
- lorin@famo.us
Expand Down
4 changes: 2 additions & 2 deletions spec/bin/famous.js
Expand Up @@ -9,7 +9,7 @@ tap.test(function(t) {

t.test(function(t) {
t.plan(3);
exec('bin/famous.js', ['fubfub'], function(error, stdout, stderr) {
exec('node bin/famous.js', ['fubfub'], function(error, stdout, stderr) {
t.ok(stdout.match(/Usage:.*/), "unrecognized subcommand should output help");
t.ok(!error, "unrecognized subcommand should output help");
t.ok(!stderr, "unrecognized subcommand should output help");
Expand All @@ -21,7 +21,7 @@ tap.test(function(t) {
t.test(function(t) {
t.plan(11);

exec('bin/famous.js', function(error, stdout, stderr) {
exec('node bin/famous.js', function(error, stdout, stderr) {
t.ok(stdout.match(/Usage:.*/), "famous should output usage info");
t.ok(stdout.match(/Commands:.*/), "famous should output commands info");
t.ok(stdout.match(/Options:.*/), "famous should output Options info");
Expand Down
8 changes: 8 additions & 0 deletions spec/lib/autoupdate.js
Expand Up @@ -58,6 +58,9 @@ test(function(t) {
var storageMock = {
getGlobal: sinon.stub().callsArgWith(0, null, null)
}
var metricsMock = {
setTracking: sinon.stub().callsArgWith(1, null)
}
var inquirerMock = {
prompt: sinon.stub().callsArgWith(1, {tracking:false})
}
Expand All @@ -66,6 +69,7 @@ test(function(t) {

autoupdate.__set__('storage', storageMock);
autoupdate.__set__('inquirer', inquirerMock);
autoupdate.__set__('metrics', metricsMock);

checkTracking = autoupdate.__get__('checkTracking');
checkTracking(function (error) {
Expand All @@ -82,6 +86,9 @@ test(function(t) {
var storageMock = {
getGlobal: sinon.stub().callsArgWith(0, null, {})
}
var metricsMock = {
setTracking: sinon.stub().callsArgWith(1, null)
}
var inquirerMock = {
prompt: sinon.stub().callsArgWith(1, {tracking:false})
}
Expand All @@ -90,6 +97,7 @@ test(function(t) {

autoupdate.__set__('storage', storageMock);
autoupdate.__set__('inquirer', inquirerMock);
autoupdate.__set__('metrics', metricsMock);

checkTracking = autoupdate.__get__('checkTracking');
checkTracking(function (error) {
Expand Down
10 changes: 10 additions & 0 deletions spec/setup.js
@@ -0,0 +1,10 @@
var storage = require('../res/sdk-bundle').storage;

storage.setGlobal({
"user": {
"email": "test@testing.com"
},
"authentication_token":"xyYdEW-_3fxGd8Z_eEeo",
"tracking":true,
"mixpanel_id":"75fgF0zZO7d7sdfs1HwbfgO/R5r7c2nl7IkmYK5bY="
}, function(){});

0 comments on commit e33283f

Please sign in to comment.