-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clients(devtools): expose registerLocaleData to worker #9645
Changes from 4 commits
75b8ea8
a979374
ade7757
2e47b75
cd9f8fd
34db89b
573042f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,16 @@ describe('i18n', () => { | |
}); | ||
|
||
describe('#registerLocaleData', () => { | ||
const moduleLocales = require('../../../lib/i18n/locales.js'); | ||
const clonedLocales = JSON.parse(JSON.stringify(moduleLocales)); | ||
|
||
// Restore locales to original state | ||
afterEach(() => { | ||
// eslint-disable-next-line no-unused-vars | ||
let replacedLocales = require('../../../lib/i18n/locales.js'); | ||
replacedLocales = clonedLocales; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like this wouldn't restore it (just overwrite the local var)? It might have to restore all the individual props (or just the single test could do it for just the one locale) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. quite true. addressed in cd9f8fd |
||
}); | ||
|
||
it('installs new locale strings', () => { | ||
const localeData = { | ||
'lighthouse-core/test/lib/i18n/i18n-test.js | testString': { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to export the lookupLocale with this function too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call. done.