-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log warnings if locale is unsupported
- Loading branch information
1 parent
3a1ed77
commit 58fbaa3
Showing
2 changed files
with
34 additions
and
19 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,15 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { importMessages } from '../../../lib/components/i18n'; | ||
|
||
afterEach(() => { | ||
jest.restoreAllMocks(); | ||
}); | ||
|
||
it('logs a warning if an unknown locale was provided', async () => { | ||
jest.spyOn(console, 'warn'); | ||
const messages = await importMessages('klh'); | ||
expect(messages).toEqual([]); | ||
expect(console.warn).toHaveBeenCalledWith(`[AwsUi] [importMessages] Unknown locale "klh" provided to importMessages`); | ||
}); |