aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Hofer <[email protected]>2024-04-29 05:24:45 -0400
committerGitHub <[email protected]>2024-04-29 11:24:45 +0200
commitf6827505712f48e448d4d4ef2dc3198e6967bbad (patch)
treeeb5b438a1675c1fe40142189493c757e97664ab7 /test
parent91a4d3d17ebc3fc4733344670349e4a1c69ce813 (diff)
downloadfaker-f6827505712f48e448d4d4ef2dc3198e6967bbad.tar.xz
faker-f6827505712f48e448d4d4ef2dc3198e6967bbad.zip
feat(music): add album and artist methods (#2620)
Diffstat (limited to 'test')
-rw-r--r--test/modules/__snapshots__/music.spec.ts.snap12
-rw-r--r--test/modules/music.spec.ts22
2 files changed, 33 insertions, 1 deletions
diff --git a/test/modules/__snapshots__/music.spec.ts.snap b/test/modules/__snapshots__/music.spec.ts.snap
index 1060a54e..0998ab50 100644
--- a/test/modules/__snapshots__/music.spec.ts.snap
+++ b/test/modules/__snapshots__/music.spec.ts.snap
@@ -1,13 +1,25 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+exports[`music > 42 > album 1`] = `"Heard It In A Past Life"`;
+
+exports[`music > 42 > artist 1`] = `"James TW"`;
+
exports[`music > 42 > genre 1`] = `"German Folk"`;
exports[`music > 42 > songName 1`] = `"I Honestly Love You"`;
+exports[`music > 1211 > album 1`] = `"Tu Veneno Mortal"`;
+
+exports[`music > 1211 > artist 1`] = `"Tove Lo"`;
+
exports[`music > 1211 > genre 1`] = `"Swing"`;
exports[`music > 1211 > songName 1`] = `"Wedding Bell Blues"`;
+exports[`music > 1337 > album 1`] = `"Dulce Beat"`;
+
+exports[`music > 1337 > artist 1`] = `"Evanescence"`;
+
exports[`music > 1337 > genre 1`] = `"Drinking Songs"`;
exports[`music > 1337 > songName 1`] = `"Frankenstein"`;
diff --git a/test/modules/music.spec.ts b/test/modules/music.spec.ts
index a34091e8..c422c290 100644
--- a/test/modules/music.spec.ts
+++ b/test/modules/music.spec.ts
@@ -7,12 +7,32 @@ const NON_SEEDED_BASED_RUN = 5;
describe('music', () => {
seededTests(faker, 'music', (t) => {
- t.itEach('genre', 'songName');
+ t.itEach('album', 'artist', 'genre', 'songName');
});
describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))(
'random seeded tests for seed %i',
() => {
+ describe('album()', () => {
+ it('should return an album name', () => {
+ const album = faker.music.album();
+
+ expect(album).toBeTruthy();
+ expect(album).toBeTypeOf('string');
+ expect(faker.definitions.music.album).toContain(album);
+ });
+ });
+
+ describe('artist()', () => {
+ it('should return an artist', () => {
+ const artist = faker.music.artist();
+
+ expect(artist).toBeTruthy();
+ expect(artist).toBeTypeOf('string');
+ expect(faker.definitions.music.artist).toContain(artist);
+ });
+ });
+
describe('genre()', () => {
it('should return a genre', () => {
const genre = faker.music.genre();