Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('Arguments are non numeric', () => {
[random.word(), (`${random.number()}`).split(''), {}].forEach((element) => {
it('Should return false', () => {
expect(greaterThan(element, 0)).to.equal(false);
});
});
});
});
describe('Arguments are non numeric', () => {
[random.word(), (`${random.number()}`).split(''), {}].forEach((element) => {
it('Should return false', () => {
expect(lessThan(element, 0)).to.equal(false);
});
});
});
});
import { expect } from 'chai';
import { random } from 'faker';
import { sample } from 'lodash';
import equals from '.';
const VALUES = [
random.word(),
random.number(),
{ [random.objectElement()]: random.word() },
[random.arrayElement()],
random.boolean()
];
const LOOSE_PAIRS = [
[1, '1'],
[1, true],
[false, 0],
[undefined, null]
];
describe('Equals rule', () => {
it('Should return true for same value', () => {
VALUES.forEach((value) => expect(equals(value, value)).to.equal(true));
private getRandomUser(max: number = this.usersMap.size - 1): UserData {
return this.usersMap.get(this.userIds[random.number({ max, precision: 1 })])
}
}
export const makeHistory = (): History => ({
task: random.words(),
title: random.words(),
url: internet.url(),
filename: system.fileName(),
details: random.words(),
time: date.past().toUTCString(),
id: random.number(100),
});
beforeEach(() => {
arg0 = random.number();
});
@autobind handleClick() {
let width = 30;
let height = 4;
let x = random.number(this.refs.container.elementRect.width - width);
let y = random.number(this.refs.container.elementRect.height - height);
this.setState(({ windows }) => {
let index = windows.length;
windows = windows.concat([ { x, y, width, height, onDrag: (x, y) => {
this.handleDrag(index, x, y);
}, onDelete: () => {
this.handleDelete(index);
} } ]);
return { windows };
});
beforeEach(() => {
arg0 = random.number();
});
Image: () => ({
...connectable(),
image_url: generateImage(
random.number({ min: 200, max: 800 }),
random.number({ min: 200, max: 800 })
),
}),
const connectable = () => ({
href: `/blocks/${random.number({ min: 1, max: 1000 })}`,
created_at: `${random.number({ min: 1, max: 10 })} hours ago`,
updated_at: `${random.number({ min: 1, max: 10 })} hours ago`,
})