-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added/ support for country name added to method & docs
- Loading branch information
1 parent
7a3fff6
commit 0cbc266
Showing
6 changed files
with
534 additions
and
259 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
import CountriesAtlas from '../helpers/CountriesAtlas'; | ||
|
||
const flag_path = path.join(__dirname, '../../flags/svg') | ||
|
||
describe('flag', () => { | ||
it('should have all flags', () => { | ||
const countries = CountriesAtlas.getCountries(['iso2']).map(country => country.iso2) | ||
const flags = fs.readdirSync(flag_path) | ||
const flags_iso2 = flags.map(flag => flag.split('.')[0].toUpperCase()) | ||
const flags_iso2_filtered = flags_iso2.filter(flag => flag !== '') | ||
expect(countries).toEqual(expect.arrayContaining(flags_iso2_filtered)) | ||
}) | ||
} | ||
) |
Oops, something went wrong.