Skip to content

Commit

Permalink
test: reuse times
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Feb 11, 2022
1 parent fd302b4 commit 6c41d5a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions test/lorem.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import validator from 'validator';
import { afterEach, describe, expect, it } from 'vitest';
import { faker } from '../src';
import validator from 'validator';
import { times } from './support/times';

const seededRuns = [
{
Expand Down Expand Up @@ -96,17 +97,6 @@ const functionNames = [
'lines',
];

// TODO @Shinigami92 2022-02-11: Maybe we can extract and reuse this in other places?
/**
* Generates a number sequence from 1 to `lenght`.
*
* @param length The length of the sequence.
* @returns The sequence.
*/
function times(length: number): number[] {
return Array.from({ length }, (_, i) => i + 1);
}

describe('lorem', () => {
afterEach(() => {
faker.locale = 'en';
Expand Down

0 comments on commit 6c41d5a

Please sign in to comment.