Use expect's instanceOf and toHaveProperty methods
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
var a = 1;
|
||||
|
||||
function rest() {
|
||||
var b = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : a;
|
||||
expect(b).toBe(1);
|
||||
}
|
||||
|
||||
rest(undefined, 2);
|
||||
|
||||
function rest2() {
|
||||
var b = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : a;
|
||||
expect(arguments.length <= 1 ? undefined : arguments[1]).toBe(2);
|
||||
}
|
||||
|
||||
rest2(undefined, 2);
|
||||
|
||||
function rest3() {
|
||||
var b = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : a;
|
||||
expect(arguments.length <= 1 ? 0 : arguments.length - 1).toBe(1);
|
||||
}
|
||||
|
||||
rest3(undefined, 2);
|
||||
Reference in New Issue
Block a user