Skip to content

Commit

Permalink
improving TS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Jul 15, 2018
1 parent ba20bf9 commit 1f1008d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
6 changes: 5 additions & 1 deletion test/main.js
Expand Up @@ -17,7 +17,11 @@ a.params = {
second: 'hello!'
};
var cs = a.build();
a.setDefaults({});
a.setDefaults({
hosts: [
{ name: '[::]', port: 123, isIPv6: true }
]
});
a.setDefaults({
user: '',
password: ''
Expand Down
22 changes: 13 additions & 9 deletions test/main.ts
@@ -1,17 +1,17 @@
import {ConnectionString} from '../src'

var a = new ConnectionString('protocol://');
var b = new ConnectionString('protocol://', {});
var c = new ConnectionString('protocol://', {
const a = new ConnectionString('protocol://');
const b = new ConnectionString('protocol://', {});
const c = new ConnectionString('protocol://', {
segments: ['one', 'two']
});

if ('protocol' in a) {
var protocol = a.protocol;
const protocol = a.protocol;
}

var segment1: string = a.segments[0];
var param1: string = a.params['first'];
const segment1: string = a.segments[0];
const param1: string = a.params['first'];

a.params['first'] = 'hello';

Expand All @@ -20,8 +20,12 @@ a.params = {
second: 'hello!'
};

var cs = a.build();
a.setDefaults({});
let cs = a.build();
a.setDefaults({
hosts: [
{name: '[::]', port: 123, isIPv6: true}
]
});

a.setDefaults({
user: '',
Expand All @@ -30,4 +34,4 @@ a.setDefaults({

cs = a.build();

var qq: ConnectionString = a.setDefaults(new ConnectionString(''));
const qq: ConnectionString = a.setDefaults(new ConnectionString(''));

0 comments on commit 1f1008d

Please sign in to comment.