New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@untemps/react-vocal

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@untemps/react-vocal - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

2

CHANGELOG.md

@@ -0,1 +1,3 @@

## [1.5.4](https://github.com/untemps/react-vocal/compare/v1.5.3...v1.5.4) (2021-04-27)
## [1.5.3](https://github.com/untemps/react-vocal/compare/v1.5.2...v1.5.3) (2020-12-26)

@@ -2,0 +4,0 @@

2

package.json
{
"name": "@untemps/react-vocal",
"version": "1.5.3",
"version": "1.5.4",
"author": "Vincent Le Badezet <v.lebadezet@untemps.net>",

@@ -5,0 +5,0 @@ "repository": "git@github.com:untemps/react-vocal.git",

@@ -32,2 +32,10 @@ import React from 'react'

it('renders no children element if SpeechRecognition is not supported', () => {
jest.spyOn(SpeechRecognitionWrapper, 'isSupported', 'get').mockReturnValueOnce(false)
const { queryByTestId } = render(getInstance(null, <div data-testid="__vocal-custom-root__" />))
expect(queryByTestId('__vocal-root__')).not.toBeInTheDocument()
expect(queryByTestId('__vocal-custom-root__')).not.toBeInTheDocument()
jest.clearAllMocks()
})
it('renders custom children function', () => {

@@ -34,0 +42,0 @@ const { queryByTestId } = render(getInstance(null, () => <div data-testid="__vocal-custom-root__" />))

import SpeechRecognitionWrapper from '../SpeechRecognitionWrapper'
import * as userPermissionsUtils from '@untemps/user-permissions-utils'

@@ -12,2 +13,23 @@ describe('SpeechRecognitionWrapper', () => {

})
it('throws error when getUserMediaStream returns false value', async () => {
const onError = jest.fn()
jest.spyOn(userPermissionsUtils, 'getUserMediaStream').mockResolvedValueOnce(null)
const wrapper = new SpeechRecognitionWrapper()
wrapper.addEventListener('error', onError)
await wrapper.start()
expect(onError).toHaveBeenCalledWith(new Error('Unable to retrieve the stream from media device'))
})
it('throws error when getUserMediaStream throws', async () => {
const onError = jest.fn()
const error = new Error('foo')
jest.spyOn(userPermissionsUtils, 'getUserMediaStream').mockImplementationOnce(() => {
throw error
})
const wrapper = new SpeechRecognitionWrapper()
wrapper.addEventListener('error', onError)
await wrapper.start()
expect(onError).toHaveBeenCalledWith(error)
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc