Пример #1
0
 it(`should return "false" when not passed a String`, () => {
     expect(isString(new Array())).toBe(false);
     expect(isString([])).toBe(false);
     expect(isString(args)).toBe(false);
     expect(isString(arrLikeObj)).toBe(false);
     expect(isString(new Boolean())).toBe(false);
     expect(isString(true)).toBe(false);
     expect(isString(new Date())).toBe(false);
     expect(isString(new Error())).toBe(false);
     expect(isString(new Function())).toBe(false);
     expect(isString(function () {})).toBe(false);
     expect(isString(null)).toBe(false);
     expect(isString(new Number())).toBe(false);
     expect(isString(0)).toBe(false);
     expect(isString(new Object())).toBe(false);
     expect(isString({})).toBe(false);
     expect(isString(new RegExp(`regexp`))).toBe(false);
     expect(isString(/regexp/)).toBe(false);
     expect(isString(undefined)).toBe(false);
 });
Пример #2
0
 it(`should return "true" when passed a String`, () => {
     expect(isString(new String())).toBe(true);
     expect(isString(``)).toBe(true);
 });