Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

corti

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

corti

Replace window.SpeechRecognition with a mock object and automate your tests

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
92
increased by26.03%
Maintainers
1
Weekly downloads
 
Created
Source

Corti

Build Status Dependency Status

Corti is a drop in replacement for the browser's SpeechRecognition object. It mocks some of the behaviour of the native object to facilitate automated testing, and provides a number of extra methods beyond the spec to help testing.

For an example of using Corti to test a real project, check out SpeechKITT.

To easily use Speech Recognition in your own project, check out annyang.

Sample Test With Corti

Corti.patch();
var recognition = new window.SpeechRecognition();
expect(recognition.isStarted()).toBe(false);
recognition.onstart = function() {console.log('I\'m listening');};
recognition.addEventListener('end', function() {console.log('Quiet');});
recognition.start();
expect(recognition.isStarted()).toBe(true);
recognition.abort();
expect(recognition.isStarted()).toBe(false);
Corti.unpatch();

Methods Currently Mocked

  • start()
  • abort()
  • stop()
  • addEventListener()

Extra Utility Methods Added To Object

  • isStarted()

Author

Tal Ater: @TalAter

License

Licensed under MIT.

Keywords

FAQs

Package last updated on 24 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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