Skip to content

Commit ba4ef9a

Browse files
authored
feat(commerce): more varied product descriptions (#3174)
1 parent 6a9ca8a commit ba4ef9a

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed
Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
export default [
2-
'Andy shoes are designed to keeping in mind durability as well as trends, the most stylish range of shoes & sandals',
3-
"Boston's most advanced compression wear technology increases muscle oxygenation, stabilizes active muscles",
4-
'Carbonite web goalkeeper gloves are ergonomically designed to give easy fit',
5-
'Ergonomic executive chair upholstered in bonded black leather and PVC padded seat and back for all-day comfort and support',
6-
'New ABC 13 9370, 13.3, 5th Gen CoreA5-8250U, 8GB RAM, 256GB SSD, power UHD Graphics, OS 10 Home, OS Office A & J 2016',
7-
'New range of formal shirts are designed keeping you in mind. With fits and styling that will make you stand apart',
8-
'The Apollotech B340 is an affordable wireless mouse with reliable connectivity, 12 months battery life and modern design',
9-
'The Football Is Good For Training And Recreational Purposes',
10-
'The Nagasaki Lander is the trademarked name of several series of Nagasaki sport bikes, that started with the 1984 ABC800J',
11-
'The automobile layout consists of a front-engine design, with transaxle-type transmissions mounted at the rear of the engine and four wheel drive',
12-
'The beautiful range of Apple Naturalé that has an exciting mix of natural ingredients. With the Goodness of 100% Natural Ingredients',
13-
'The slim & simple Maple Gaming Keyboard from Dev Byte comes with a sleek body and 7- Color RGB LED Back-lighting for smart functionality',
2+
'Discover the {{animal.type}}-like agility of our {{commerce.product}}, perfect for {{word.adjective}} users',
3+
'Discover the {{word.adjective}} new {{commerce.product}} with an exciting mix of {{commerce.productMaterial}} ingredients',
4+
'Ergonomic {{commerce.product}} made with {{commerce.productMaterial}} for all-day {{word.adjective}} support',
5+
'Experience the {{color.human}} brilliance of our {{commerce.product}}, perfect for {{word.adjective}} environments',
6+
'Featuring {{science.chemical_element.name}}-enhanced technology, our {{commerce.product}} offers unparalleled {{word.adjective}} performance',
7+
'Innovative {{commerce.product}} featuring {{word.adjective}} technology and {{commerce.productMaterial}} construction',
8+
'Introducing the {{location.country}}-inspired {{commerce.product}}, blending {{word.adjective}} style with local craftsmanship',
9+
'New {{color.human}} {{commerce.product}} with ergonomic design for {{word.adjective}} comfort',
10+
'New {{commerce.product}} model with {{number.int({"min": 1, "max": 100})}} GB RAM, {{number.int({"min": 1, "max": 1000})}} GB storage, and {{word.adjective}} features',
11+
'Our {{animal.type}}-friendly {{commerce.product}} ensures {{word.adjective}} comfort for your pets',
12+
'Our {{food.adjective}}-inspired {{commerce.product}} brings a taste of luxury to your {{word.adjective}} lifestyle',
13+
'Professional-grade {{commerce.product}} perfect for {{word.adjective}} training and recreational use',
14+
'Savor the {{food.adjective}} essence in our {{commerce.product}}, designed for {{word.adjective}} culinary adventures',
15+
'Stylish {{commerce.product}} designed to make you stand out with {{word.adjective}} looks',
16+
'The sleek and {{word.adjective}} {{commerce.product}} comes with {{color.human}} LED lighting for smart functionality',
17+
'The {{color.human}} {{commerce.product}} combines {{location.country}} aesthetics with {{science.chemical_element.name}}-based durability',
18+
'The {{company.catchPhrase}} {{commerce.product}} offers reliable performance and {{word.adjective}} design',
19+
'The {{person.firstName}} {{commerce.product}} is the latest in a series of {{word.adjective}} products from {{company.name}}',
20+
'{{commerce.productAdjective}} {{commerce.product}} designed with {{commerce.productMaterial}} for {{word.adjective}} performance',
21+
"{{company.name}}'s most advanced {{commerce.product}} technology increases {{word.adjective}} capabilities",
1422
];

src/modules/commerce/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ export class CommerceModule extends ModuleBase {
254254
* Returns a product description.
255255
*
256256
* @example
257-
* faker.commerce.productDescription() // 'Andy shoes are designed to keeping...'
257+
* faker.commerce.productDescription() // 'Featuring Phosphorus-enhanced technology, our Fish offers unparalleled Modern performance'
258258
*
259259
* @since 5.0.0
260260
*/
261261
productDescription(): string {
262-
return this.faker.helpers.arrayElement(
262+
return this.faker.helpers.fake(
263263
this.faker.definitions.commerce.product_description
264264
);
265265
}

test/modules/__snapshots__/commerce.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports[`commerce > 42 > product 1`] = `"Computer"`;
3030

3131
exports[`commerce > 42 > productAdjective 1`] = `"Handcrafted"`;
3232

33-
exports[`commerce > 42 > productDescription 1`] = `"New ABC 13 9370, 13.3, 5th Gen CoreA5-8250U, 8GB RAM, 256GB SSD, power UHD Graphics, OS 10 Home, OS Office A & J 2016"`;
33+
exports[`commerce > 42 > productDescription 1`] = `"New salmon Pants with ergonomic design for crushing comfort"`;
3434

3535
exports[`commerce > 42 > productMaterial 1`] = `"Frozen"`;
3636

@@ -66,7 +66,7 @@ exports[`commerce > 1211 > product 1`] = `"Towels"`;
6666

6767
exports[`commerce > 1211 > productAdjective 1`] = `"Tasty"`;
6868

69-
exports[`commerce > 1211 > productDescription 1`] = `"The slim & simple Maple Gaming Keyboard from Dev Byte comes with a sleek body and 7- Color RGB LED Back-lighting for smart functionality"`;
69+
exports[`commerce > 1211 > productDescription 1`] = `"Small Cheese designed with Wooden for right performance"`;
7070

7171
exports[`commerce > 1211 > productMaterial 1`] = `"Wooden"`;
7272

@@ -102,7 +102,7 @@ exports[`commerce > 1337 > product 1`] = `"Chicken"`;
102102

103103
exports[`commerce > 1337 > productAdjective 1`] = `"Generic"`;
104104

105-
exports[`commerce > 1337 > productDescription 1`] = `"Ergonomic executive chair upholstered in bonded black leather and PVC padded seat and back for all-day comfort and support"`;
105+
exports[`commerce > 1337 > productDescription 1`] = `"Innovative Car featuring lawful technology and Fresh construction"`;
106106

107107
exports[`commerce > 1337 > productMaterial 1`] = `"Fresh"`;
108108

test/modules/commerce.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,10 @@ describe('commerce', () => {
187187
});
188188

189189
describe(`productDescription()`, () => {
190-
it('should return random value from product description array', () => {
190+
it('should return a product description string', () => {
191191
const actual = faker.commerce.productDescription();
192-
expect(faker.definitions.commerce.product_description).toContain(
193-
actual
194-
);
192+
expect(actual).toBeTruthy();
193+
expect(actual).toBeTypeOf('string');
195194
});
196195
});
197196

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy