-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor tests so that the stx tests also run in NodeJS
It would be nice to have tests split up into modules, but this causes all kinds of headaches with running the tests in both the browser and NodeJS. So we're keeping them in one file for now.
- Loading branch information
Showing
8 changed files
with
354 additions
and
328 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,7 @@ class Builder { | |
* @example const stanza = Builder.fromString('<presence from="[email protected]/chamber"></presence>'); | ||
*/ | ||
static fromString(str) { | ||
const el = toElement(str); | ||
const el = toElement(str, true); | ||
const b = new Builder(''); | ||
b.#nodeTree = el; | ||
return b; | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ declare class Builder { | |
* Creates a new Builder object from an XML string. | ||
* @param {string} str | ||
* @returns {Builder} | ||
* @example const stanza = Builder.fromString('<presence from='[email protected]/chamber'></presence>'); | ||
* @example const stanza = Builder.fromString('<presence from="[email protected]/chamber"></presence>'); | ||
*/ | ||
static fromString(str: string): Builder; | ||
/** | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ export class Stanza extends Builder { | |
* const pres = stx` | ||
* <presence from='[email protected]/chamber' id='pres1'> | ||
* <show>dnd</show> | ||
* ${unsafeXML(status) | ||
* ${unsafeXML(status)} | ||
* </presence>`; | ||
* connection.send(pres); | ||
*/ | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.