Created
December 19, 2011 15:35
-
-
Save c4milo/1497704 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<title>Swarm Javascript Library Specifications</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" charset="utf-8"/> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" | |
type="text/javascript" | |
charset="utf-8"> | |
</script> | |
<script src="../node_modules/mocha/mocha.js" | |
type="text/javascript" | |
charset="utf-8"> | |
</script> | |
<script src="http://cdn.buglabs.net/swarm/test/swarm-v0.3.2.js" | |
type="text/javascript" | |
charset="utf-8"> | |
</script> | |
<script src="../node_modules/chai/chai.js" | |
type="text/javascript" | |
charset="utf-8"> | |
</script> | |
<script>mocha.setup('bdd')</script> | |
<!-- Linking spec files --> | |
<script src="swarm.spec.js" | |
type="text/javascript" | |
charset="utf-8"> | |
</script> | |
<script> | |
onload = function() { | |
mocha.run(); | |
require('chai').should(); | |
}; | |
</script> | |
</head> | |
<body> | |
<div id='mocha'/> | |
</body> | |
</html> |
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
describe('Swarm Javascript API', function() { | |
it('should connect to the platform', function(done) { | |
SWARM.connect({ apikey: '3e98ac6ca152f9bc279d0ef6e6bc9877e1508fd8', | |
resource: '0da7ce672f5a2e067ee8a0e050ca3e363283ea39', | |
swarms: ['db07c1f9ff0628e33378cf39dc16df0755cdd3f0'], | |
onconnect: function() { | |
true.should.be.true; | |
done(); | |
}, | |
onerror: function(errors) { | |
//failing on purpose since this function shouldn't be called. | |
errors.errors.should.be.empty(); | |
}}); | |
}); | |
it('should join swarms and receive presence', function(done) { | |
done(); | |
}); | |
it('should send public messages to all the swarms where it has presence', function(done) { | |
done(); | |
}); | |
it('should send public messages to specific swarms', function(done) { | |
done(); | |
}); | |
it('should send private messages', function(done) { | |
done(); | |
}); | |
it('should leave swarms', function(done) { | |
done(); | |
}); | |
it('should disconnect', function(done) { | |
done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment