This repository has been archived by the owner on Nov 6, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */ | ||
const { getGamesAmerica } = require('../src'); | ||
const { getQueriedGamesAmerica } = require('../src'); | ||
|
||
describe('getGamesAmerica - CommonJS', () => { | ||
test('should allow custom limit', async () => { | ||
const data = await getGamesAmerica({ limit: 1 }); | ||
expect(data).toBeInstanceOf(Object); | ||
expect(data).toHaveLength(1); | ||
}); | ||
describe('CommonJS Require test', () => { | ||
test('GIVEN Pokemon THEN returns results with some known games', async () => { | ||
const data = await getQueriedGamesAmerica('Pokemon'); | ||
|
||
test('should allow unfiltered shop', async () => { | ||
jest.setTimeout(60000); | ||
const data = await getGamesAmerica(); | ||
expect(data).toBeInstanceOf(Object); | ||
expect(data.length).toBeGreaterThanOrEqual(1500); | ||
expect(data.length).toBeGreaterThanOrEqual(20); | ||
|
||
expect(data).toEqual( | ||
expect.arrayContaining([ | ||
// Expect Pokémon™ Legends: Arceus to be in the data | ||
expect.objectContaining({ | ||
title: 'Pokémon™ Legends: Arceus' | ||
}), | ||
// Expect Pokémon™ Brilliant Diamond to be in the data | ||
expect.objectContaining({ | ||
title: 'Pokémon™ Brilliant Diamond' | ||
}), | ||
// Expect New Pokémon Snap to be in the data | ||
expect.objectContaining({ | ||
title: 'New Pokémon Snap™' | ||
}) | ||
]) | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters