-
-
Save thepatrick/7e2deb2f48ae2e3eb24b 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
var test = require('./helpers'); | |
// Single endpoint: | |
// Connect and check the properties of the connection | |
test(function($) { | |
return $(0).connect().then(function(connection) { | |
$.expect(connection).is.any.connection(); | |
}); | |
}); | |
// Two endpoints: | |
// Connect and Publish + Connect and Subscribe | |
// wait function just for fun, not needed for this example | |
test(function($) { // for performance reasons all tests in a kit should have the some number of endpoints | |
$(0).connect().publish(); | |
$(1).connect(); | |
return $(1).on('stream', 'created', function(stream) { | |
// TODO: Think about replacing $(0).session() with $('0.session') | |
$.expect(stream).to.be.any.stream({ withConnection: $('0.session') });); | |
return stream.subscribe().wait(2000).pass(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment