Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jsxc/jsxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsualko <klaus@jsxc.org>2019-05-16 14:43:23 +0300
committersualko <klaus@jsxc.org>2019-05-16 14:43:23 +0300
commit4bcf1255f7c92811e89c7efa060371763ffc3213 (patch)
tree02c2203e96eb251f46ca264ed429e5deee9d88f1 /test
parent4441c709c5d3c8775a088281c8b1befc2fd8f533 (diff)
test: fix typescript format
Diffstat (limited to 'test')
-rw-r--r--test/JID.spec.ts20
-rw-r--r--test/connection/Form.spec.ts7
-rw-r--r--test/util/HookRepository.spec.ts4
-rw-r--r--test/util/Pipe.spec.ts2
4 files changed, 16 insertions, 17 deletions
diff --git a/test/JID.spec.ts b/test/JID.spec.ts
index a8bae877..c3eed6a8 100644
--- a/test/JID.spec.ts
+++ b/test/JID.spec.ts
@@ -10,16 +10,16 @@ class JIDDummy {
public toEscapedString() {
let node = this.node.replace(/^\s+|\s+$/g, '')
- .replace(/\\/g, "\\5c")
- .replace(/ /g, "\\20")
- .replace(/\"/g, "\\22")
- .replace(/\&/g, "\\26")
- .replace(/\'/g, "\\27")
- .replace(/\//g, "\\2f")
- .replace(/:/g, "\\3a")
- .replace(/</g, "\\3c")
- .replace(/>/g, "\\3e")
- .replace(/@/g, "\\40");
+ .replace(/\\/g, '\\5c')
+ .replace(/ /g, '\\20')
+ .replace(/\"/g, '\\22')
+ .replace(/\&/g, '\\26')
+ .replace(/\'/g, '\\27')
+ .replace(/\//g, '\\2f')
+ .replace(/:/g, '\\3a')
+ .replace(/</g, '\\3c')
+ .replace(/>/g, '\\3e')
+ .replace(/@/g, '\\40');
return node + '@' + this.domain + ((this.resource) ? '/' + this.resource : '');
}
diff --git a/test/connection/Form.spec.ts b/test/connection/Form.spec.ts
index fbf29afc..7e12b643 100644
--- a/test/connection/Form.spec.ts
+++ b/test/connection/Form.spec.ts
@@ -63,8 +63,8 @@ const exampleXMLForm = $.parseXML(`<x xmlns='jabber:x:data' type='${formType}'>
const exampleJSONForm = {
type: formType,
- title: title,
- instructions: instructions,
+ title,
+ instructions,
fields: [{
type: 'hidden',
name: 'FORM_TYPE',
@@ -138,7 +138,6 @@ const exampleHTMLForm = $.parseHTML(`<form data-type="${formType}" autocomplete=
</div>
</form>`)[0];
-
describe('XEP-0004: Data Forms', function() {
it('should parse a XML form', function() {
let form = Form.fromXML(exampleXMLForm);
@@ -161,7 +160,7 @@ describe('XEP-0004: Data Forms', function() {
});
it('should parse a HTML form', function() {
- let form = Form.fromHTML(<Element>exampleHTMLForm);
+ let form = Form.fromHTML(<Element> exampleHTMLForm);
expect(form.getType()).equals('submit');
expect(form.getValues('features')[0]).equals('news');
diff --git a/test/util/HookRepository.spec.ts b/test/util/HookRepository.spec.ts
index b59b5479..3e6a807d 100644
--- a/test/util/HookRepository.spec.ts
+++ b/test/util/HookRepository.spec.ts
@@ -102,8 +102,8 @@ describe('HookRepository', () => {
})
it('should not crash if you remove unregistered hooks', () => {
- this.hookRepository.registerHook('foo', () => { return 1; })
+ this.hookRepository.registerHook('foo', () => 1)
- this.hookRepository.removeHook('foo', () => { return 2; })
+ this.hookRepository.removeHook('foo', () => 2)
})
});
diff --git a/test/util/Pipe.spec.ts b/test/util/Pipe.spec.ts
index 14324da3..924f4bb7 100644
--- a/test/util/Pipe.spec.ts
+++ b/test/util/Pipe.spec.ts
@@ -70,7 +70,7 @@ describe('Pipe', () => {
}).to.throw();
expect(() => {
- pipeA.addProcessor(function(...args) { return Promise.resolve(); }, <any>'abc');
+ pipeA.addProcessor(function(...args) { return Promise.resolve(); }, <any> 'abc');
}).to.throw();
})
});