aboutsummaryrefslogtreecommitdiff
path: root/test/lorem.spec.ts
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-02-20 18:32:49 +0100
committerGitHub <[email protected]>2022-02-20 18:32:49 +0100
commitbfa7946f7ef5c025c2af9165191ffced4a7dde9d (patch)
tree5c3e0e619b529be10da0be5b1f83d71437c9436f /test/lorem.spec.ts
parent2448aab2fca711ef18857e27690f94440b517d84 (diff)
downloadfaker-bfa7946f7ef5c025c2af9165191ffced4a7dde9d.tar.xz
faker-bfa7946f7ef5c025c2af9165191ffced4a7dde9d.zip
test: use toBeTypeOf (#511)
Diffstat (limited to 'test/lorem.spec.ts')
-rw-r--r--test/lorem.spec.ts40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/lorem.spec.ts b/test/lorem.spec.ts
index f4051107..c2690e2e 100644
--- a/test/lorem.spec.ts
+++ b/test/lorem.spec.ts
@@ -111,7 +111,7 @@ describe('lorem', () => {
const actual = faker.lorem[functionName]();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual).toEqual(expectations[functionName]);
});
}
@@ -128,7 +128,7 @@ describe('lorem', () => {
const actual = faker.lorem.word();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(faker.definitions.lorem.words).toContain(actual);
});
@@ -139,7 +139,7 @@ describe('lorem', () => {
const actual = faker.lorem.word(length);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(faker.definitions.lorem.words).toContain(actual);
expect(actual).toHaveLength(length);
}
@@ -151,7 +151,7 @@ describe('lorem', () => {
const actual = faker.lorem.words();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
const words = actual.split(' ');
@@ -168,7 +168,7 @@ describe('lorem', () => {
const actual = faker.lorem.words(num);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
const words = actual.split(' ');
@@ -186,7 +186,7 @@ describe('lorem', () => {
const actual = faker.lorem.sentence();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
});
@@ -196,7 +196,7 @@ describe('lorem', () => {
const actual = faker.lorem.sentence(wordCount);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
const words = actual.split(' ');
@@ -211,7 +211,7 @@ describe('lorem', () => {
const actual = faker.lorem.slug();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual).satisfy(validator.isSlug);
});
@@ -221,7 +221,7 @@ describe('lorem', () => {
const actual = faker.lorem.slug(wordCount);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
const words = actual.split('-');
@@ -239,7 +239,7 @@ describe('lorem', () => {
const actual = faker.lorem.sentences();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
});
@@ -247,7 +247,7 @@ describe('lorem', () => {
const actual = faker.lorem.sentences(sentenceCount);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
const sentences = actual.split('. ');
@@ -262,7 +262,7 @@ describe('lorem', () => {
const actual = faker.lorem.sentences(sentenceCount, separator);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
const sentences = actual.split(separator);
@@ -281,7 +281,7 @@ describe('lorem', () => {
const actual = faker.lorem.paragraph();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
});
@@ -291,7 +291,7 @@ describe('lorem', () => {
const actual = faker.lorem.paragraph(sentenceCount);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
const sentences = actual.split('. ');
@@ -307,7 +307,7 @@ describe('lorem', () => {
const actual = faker.lorem.paragraphs();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
});
@@ -315,7 +315,7 @@ describe('lorem', () => {
const actual = faker.lorem.paragraphs(paragraphCount);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
const paragraphs = actual.split('\n \r');
@@ -330,7 +330,7 @@ describe('lorem', () => {
const actual = faker.lorem.paragraphs(paragraphCount, separator);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
expect(actual[actual.length - 1]).toBe('.');
const paragraphs = actual.split(separator);
@@ -345,7 +345,7 @@ describe('lorem', () => {
const actual = faker.lorem.text();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
});
});
@@ -354,14 +354,14 @@ describe('lorem', () => {
const actual = faker.lorem.lines();
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
});
it.each(times(25))('should return %i lines', (lineCount) => {
const actual = faker.lorem.lines(lineCount);
expect(actual).toBeTruthy();
- expect(typeof actual).toBe('string');
+ expect(actual).toBeTypeOf('string');
const lines = actual.split('\n');