Cleaned up the tests.

This commit is contained in:
Marc Neumann
2017-02-17 16:19:48 +01:00
parent 4516213693
commit 534c9568dc
+17 -17
View File
@@ -3,38 +3,38 @@ import {JID} from './index';
/*
* All return an instance of JID.JID, the new operator is optional.
*/
let addr = new JID('alice@wonderland.net/rabbithole') // OK
addr = new JID('alice', 'wonderland.net', 'rabbithole') // BEST; see section on escaping below
let addr = new JID('alice@wonderland.net/rabbithole'); // OK
addr = new JID('alice', 'wonderland.net', 'rabbithole'); // BEST; see section on escaping below
/*
* local
*/
addr.local = 'alice'
addr.local // alice
addr.local = 'alice';
addr.local; // alice
// same as
addr.setLocal('alice')
addr.getLocal() // alice
addr.setLocal('alice');
addr.getLocal(); // alice
/*
* domain
*/
addr.domain = 'wonderland.net'
addr.domain // wonderland.net
addr.domain = 'wonderland.net';
addr.domain; // wonderland.net
// same as
addr.setDomain('wonderland.net')
addr.getDomain() // wonderland.net
addr.setDomain('wonderland.net');
addr.getDomain(); // wonderland.net
/*
* resource
*/
addr.resource = 'rabbithole'
addr.resource // rabbithole
addr.resource = 'rabbithole';
addr.resource; // rabbithole
// same as
addr.setResource('rabbithole')
addr.getResource() // rabbithole
addr.setResource('rabbithole');
addr.getResource(); // rabbithole
addr.toString() // alice@wonderland.net/rabbithole
addr.bare() // returns a JID without resource
addr.toString(); // alice@wonderland.net/rabbithole
addr.bare(); // returns a JID without resource
let some_jid = new JID('is', 'a', 'test');
addr.equals(some_jid) // returns true if the two JIDs are equal, false otherwise
addr.equals(some_jid); // returns true if the two JIDs are equal, false otherwise