Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- beforeEach(() => {
- global.window.speechSynthesis = {
- getVoices: () => (null),
- };
- });
- it('supports speech and locale', () => {
- const getVoicesStub = sinon.stub(
- global.window.speechSynthesis,
- 'getVoices');
- getVoicesStub.callsFake(() => (
- [{lang: 'en_US'}]
- ));
- it('will choose best matching locale', () => {
- const getVoicesStub = sinon.stub(
- global.window.speechSynthesis,
- 'getVoices');
- getVoicesStub.callsFake(() => (
- [{lang: 'es_MX'}, {lang: 'es_US'}]
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement