fix travis errors

This commit is contained in:
hansrwindhoff
2015-05-15 23:26:09 -06:00
parent 0ac773404b
commit 4f5c7c2d00
2 changed files with 14 additions and 11 deletions

View File

@@ -256,9 +256,9 @@ describe('update', function () {
}
});
assert.strictEqual(updated[0], instance[0]);
assert.notStrictEqual(updated[1], instance[1]);
assert.strictEqual(updated[1].c, instance[1].c);
assert.strictEqual((<any> updated)[0], (<any> instance)[0]);
assert.notStrictEqual((<any> updated)[1], (<any> instance)[1]);
assert.strictEqual((<any> updated)[1].c, (<any> instance)[1].c);
});
});
@@ -1328,8 +1328,8 @@ describe('tuple', function () {
it('should coerce values', function () {
var t = T([{}, {}]);
ok(S.is(t[0]));
ok(S.is(t[1]));
ok(S.is((<any> t)[0]));
ok(S.is((<any> t)[1]));
});
it('should accept only valid values', function () {
@@ -1381,8 +1381,8 @@ describe('tuple', function () {
it('should return a new instance', function () {
var newInstance = Type.update(instance, {0: {$set: 'b'}});
assert(Type.is(newInstance));
assert(instance[0] === 'a');
assert(newInstance[0] === 'b');
assert((<any> instance)[0] === 'a');
assert((<any> newInstance)[0] === 'b');
});
});
@@ -1418,7 +1418,7 @@ describe('list', function () {
it('should coerce values', function () {
var t = T([{}]);
ok(S.is(t[0]));
ok(S.is((<any> t)[0]));
});
it('should accept only valid values', function () {

9
tcomb/tcomb.d.ts vendored
View File

@@ -1,10 +1,13 @@
// Type definitions for tcomb v1.0.3
// Project: http://gcanti.github.io/tcomb/guide/index.html
// Definitions by: Jed Mao <https://github.com/jedmao> and Hans Windhoff <https://github.com/hansrwindhoff>
// Definitions by: Jed Mao <https://github.com/jedmao>
// and Hans Windhoff <https://github.com/hansrwindhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module TComb {
export interface NumbersOnly {
[idx:number]:string;
}
export interface tcomb {
format: (format: string, ...values: any[]) => string;
getFunctionName: (fn: Function) => string;
@@ -12,7 +15,7 @@ declare module TComb {
mixin: (target: {}, source: {}, overwrite?: boolean) => any;
slice: typeof Array.prototype.slice;
shallowCopy: (x: TCombBase) => TCombBase;
update: (instance: any, spec: {}) => TCombBase;
update: (instance: any, spec: {} ) => TCombBase;
assert: (condition: boolean, message?: string, ...values: any[]) => void;
fail: (message?: string) => void;
Any: Any_Static;