Skip to content

Commit

Permalink
fixes tests to work w/o isBusy
Browse files Browse the repository at this point in the history
  • Loading branch information
HipsterBrown committed Jan 27, 2016
1 parent b5bc780 commit c8e557f
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions node/test/unit/tessel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1644,17 +1644,16 @@ exports['Tessel.Wifi'] = {
},

initialized: function(test) {
test.expect(3);
test.expect(2);

test.equal(this.tessel.network.wifi.isBusy, false, 'not busy by default');
test.equal(this.tessel.network.wifi.isConnected, false, 'not connected by default');
test.deepEqual(this.tessel.network.wifi.settings, {}, 'no setings by default');

test.done();
},

connect: function(test) {
test.expect(6);
test.expect(5);

var settings = {
ssid: 'TestNetwork',
Expand Down Expand Up @@ -1694,7 +1693,6 @@ exports['Tessel.Wifi'] = {

test.deepEqual(networkSettings, results, 'correct settings');
test.deepEqual(this.tessel.network.wifi.settings, results, 'correct settings property');
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, true, 'wifi is now connected');
test.equal(this.exec.callCount, 6, 'exec called correctly');

Expand All @@ -1717,7 +1715,7 @@ exports['Tessel.Wifi'] = {
},

connectWithoutCallback: function(test) {
test.expect(5);
test.expect(4);

var settings = {
ssid: 'TestNetwork',
Expand Down Expand Up @@ -1748,7 +1746,6 @@ exports['Tessel.Wifi'] = {
this.tessel.network.wifi.on('connect', (networkSettings) => {
test.deepEqual(networkSettings, results, 'correct settings');
test.deepEqual(this.tessel.network.wifi.settings, results, 'correct settings property');
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, true, 'wifi is now connected');
test.equal(this.exec.callCount, 6, 'exec called correctly');
test.done();
Expand All @@ -1763,7 +1760,7 @@ exports['Tessel.Wifi'] = {
},

connectWithoutSecurity: function(test) {
test.expect(6);
test.expect(5);

var settings = {
ssid: 'TestNetwork',
Expand Down Expand Up @@ -1803,7 +1800,6 @@ exports['Tessel.Wifi'] = {

test.deepEqual(networkSettings, results, 'correct settings');
test.deepEqual(this.tessel.network.wifi.settings, results, 'correct settings property');
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, true, 'wifi is now connected');
test.equal(this.exec.callCount, 6, 'exec called correctly');

Expand All @@ -1812,7 +1808,7 @@ exports['Tessel.Wifi'] = {
},

connectWithoutPassword: function(test) {
test.expect(6);
test.expect(5);

var settings = {
ssid: 'TestNetwork'
Expand Down Expand Up @@ -1851,7 +1847,6 @@ exports['Tessel.Wifi'] = {

test.deepEqual(networkSettings, results, 'correct settings');
test.deepEqual(this.tessel.network.wifi.settings, results, 'correct settings property');
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, true, 'wifi is now connected');
test.equal(this.exec.callCount, 6, 'exec called correctly');

Expand All @@ -1860,7 +1855,7 @@ exports['Tessel.Wifi'] = {
},

connectThrowsError: function(test) {
test.expect(4);
test.expect(3);

var settings = {
ssid: 'TestNetwork'
Expand All @@ -1884,7 +1879,6 @@ exports['Tessel.Wifi'] = {
this.tessel.network.wifi.connect(settings, (error) => {
if (error) {
test.equal(error, testError, 'error should be passed into callback');
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, false, 'wifi is not connected');
test.done();
} else {
Expand Down Expand Up @@ -1936,7 +1930,7 @@ exports['Tessel.Wifi'] = {
},

reset: function(test) {
test.expect(4);
test.expect(3);

this.tessel.network.wifi.on('disconnect', () => {
test.ok(true, 'disconnect event is fired');
Expand All @@ -1950,15 +1944,14 @@ exports['Tessel.Wifi'] = {
test.fail(error);
test.done();
} else {
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, true, 'wifi is not connected');
test.done();
}
});
},

disable: function(test) {
test.expect(3);
test.expect(2);

this.tessel.network.wifi.on('disconnect', () => {
test.ok(true, 'disconnect event is fired');
Expand All @@ -1969,15 +1962,14 @@ exports['Tessel.Wifi'] = {
test.fail(error);
test.done();
} else {
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, false, 'wifi is not connected');
test.done();
}
});
},

enable: function(test) {
test.expect(3);
test.expect(2);

this.tessel.network.wifi.on('connect', () => {
test.ok(true, 'connect event is fired');
Expand All @@ -1988,7 +1980,6 @@ exports['Tessel.Wifi'] = {
test.fail(error);
test.done();
} else {
test.equal(this.tessel.network.wifi.isBusy, false, 'wifi is not busy');
test.equal(this.tessel.network.wifi.isConnected, true, 'wifi is not connected');
test.done();
}
Expand Down

0 comments on commit c8e557f

Please sign in to comment.