Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. beforeEach(() => {
  2. global.window.speechSynthesis = {
  3. getVoices: () => (null),
  4. };
  5. });
  6.  
  7. it('supports speech and locale', () => {
  8. const getVoicesStub = sinon.stub(
  9. global.window.speechSynthesis,
  10. 'getVoices');
  11.  
  12. getVoicesStub.callsFake(() => (
  13. [{lang: 'en_US'}]
  14. ));
  15.  
  16. it('will choose best matching locale', () => {
  17. const getVoicesStub = sinon.stub(
  18. global.window.speechSynthesis,
  19. 'getVoices');
  20.  
  21. getVoicesStub.callsFake(() => (
  22. [{lang: 'es_MX'}, {lang: 'es_US'}]
  23. ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement