Created
March 9, 2015 07:24
-
-
Save ggarber/969353cd878d5e87d041 to your computer and use it in GitHub Desktop.
JQuerized Assimilator DSL v.0.1 (but works :))
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
var test = require('./helpers'); | |
// Single endpoint: | |
// Connect and check the properties of the connection | |
test(function($) { | |
$(0).connect().then(function(connection) { | |
$.assert.isNotNull(connection.connectionId); | |
connection.pass(); | |
}); | |
}); | |
// Two endpoints: | |
// Connect and Publish + Connect and Subscribe | |
// wait function just for fun, not needed for this example | |
test({ endpoints: 2 }, function($) { | |
$(0).connect().publish(); | |
$(1).connect(); | |
$(1).on('stream', 'created', function(stream) { | |
// TODO: Think about replacing $(0).session() with $('0.session') | |
$.assert.deepEqual(stream.connection, $(0).session().connection); | |
stream.subscribe().wait(2000).pass(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment