Skip to content

Commit

Permalink
feat: adds Saudi Arabia marketplace
Browse files Browse the repository at this point in the history
BREAKING CHANGE: adds Saudi Arabia marketplace
  • Loading branch information
moltar committed Jun 20, 2020
1 parent e488788 commit dae8348
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/amazon-marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum AmazonMarketplaceCountryCode {
JP = 'JP',
MX = 'MX',
NL = 'NL',
SA = 'SA',
SG = 'SG',
TR = 'TR',
US = 'US',
Expand All @@ -37,6 +38,7 @@ export enum AmazonMarketplaceAdvertisingCurrency {
INR = 'INR',
JPY = 'JPY',
MXN = 'MXN',
SAR = 'SAR',
SGD = 'SGD',
TRY = 'TRY',
USD = 'USD',
Expand Down
14 changes: 14 additions & 0 deletions src/marketplaces/SA.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
AmazonMarketplace,
AmazonMarketplaceCountryCode,
AmazonMarketplaceAdvertisingCurrency,
} from '../amazon-marketplace'

export const SA = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.SA,
currency: AmazonMarketplaceAdvertisingCurrency.SAR,
id: 'A17E79C6D8DWNP',
name: 'Saudi Arabia',
uri: 'https://www.amazon.sa',
webServiceUri: 'https://mws-eu.amazonservices.com',
})
6 changes: 6 additions & 0 deletions src/marketplaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { IT } from './IT'
import { JP } from './JP'
import { MX } from './MX'
import { NL } from './NL'
import { SA } from './SA'
import { SG } from './SG'
import { TR } from './TR'
import { US } from './US'
Expand Down Expand Up @@ -87,6 +88,11 @@ export const amazonMarketplaces = {
*/
NL,

/**
* Singapore
*/
SA,

/**
* Singapore
*/
Expand Down
11 changes: 11 additions & 0 deletions tests/__snapshots__/marketplaces.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,17 @@ AmazonMarketplace {
}
`;

exports[`marketplace SA should match snapshot 1`] = `
AmazonMarketplace {
"countryCode": "SA",
"currency": "SAR",
"id": "A17E79C6D8DWNP",
"name": "Saudi Arabia",
"uri": "https://www.amazon.sa",
"webServiceUri": "https://mws-eu.amazonservices.com",
}
`;

exports[`marketplace SG should match snapshot 1`] = `
AmazonMarketplace {
"countryCode": "SG",
Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ describe('index', () => {

it('should also provide a list of marketplaces', () => {
expect(Array.isArray(amazonMarketplacesList)).toBeTruthy()
expect(amazonMarketplacesList.length).toBe(17)
expect(amazonMarketplacesList.length).toBe(18)
})
})
2 changes: 1 addition & 1 deletion tests/marketplaces.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('marketplace', () => {
it('has a known number of marketplaces', () => {
expect.assertions(1)

expect(countryCodes.length).toBe(17)
expect(countryCodes.length).toBe(18)
})

describe.each(countryCodes)('%s', (countryCode) => {
Expand Down

0 comments on commit dae8348

Please sign in to comment.