Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions packages/falso/src/lib/sequence.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FakeOptions, Return } from './core/core';
import { fake, FakeOptions, Return } from './core/core';
import { random } from './random';

export const numericChars = '0123456789';
Expand Down Expand Up @@ -34,13 +34,6 @@ type ReturnTypeFromCharType<CharType extends CharTypes | undefined> =
? string
: string[];

/**
* Simulating the `fake` function.
*/
function fake<T>(generatorFn: () => T, options?: any): T {
return generatorFn(); // Assuming `fake` returns the value produced by generatorFn
}

/**
* Generate a random sequence.
*
Expand Down
6 changes: 6 additions & 0 deletions packages/falso/src/tests/sequence.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,10 @@ describe('randSequence', () => {
expect(result).toHaveLength(6); // Custom size
expect(result).toMatch(/^[a-zA-Z]+$/); // Result should only contain alphabetic characters
});

// Test with length
it('should generate an array of strings', () => {
const result = randSequence({ length: 10 });
expect(result.length).toBe(10);
});
});