Comparing version 1.0.0-rc.1 to 1.0.0
//! Corti - A mock implementation of the browser's SpeechRecognition for automated testing | ||
//! version : 1.0.0-rc.1 | ||
//! version : 1.0.0 | ||
//! author : Tal Ater @TalAter | ||
@@ -4,0 +4,0 @@ //! license : MIT |
//! Corti - A mock implementation of the browser's SpeechRecognition for automated testing | ||
//! version : 1.0.0-rc.1 | ||
//! version : 1.0.0 | ||
//! author : Tal Ater @TalAter | ||
@@ -4,0 +4,0 @@ //! license : MIT |
{ | ||
"name": "corti", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0", | ||
"description": "Replace window.SpeechRecognition with a mock object and automate your tests", | ||
@@ -5,0 +5,0 @@ "keywords": ["recognition", "speech", "speechrecognition", "webkitSpeechRecognition"], |
@@ -19,3 +19,3 @@ # Corti | ||
#### In node.js | ||
#### In node.js (ESM) | ||
@@ -64,2 +64,23 @@ ```javascript | ||
#### In node.js (CJS) | ||
```javascript | ||
// Jest example | ||
const { SpeechRecognition } = require('corti'); | ||
beforeAll(() => { | ||
global.SpeechRecognition = SpeechRecognition; | ||
}); | ||
test('SpeechRecognition', () => { | ||
const speech = new globalThis.SpeechRecognition(); | ||
const spyFn = jest.fn(); | ||
speech.onresult = spyFn; | ||
speech.continuous = true; | ||
speech.start(); | ||
speech.say('Hello world'); | ||
speech.say('Hello world'); | ||
expect(spyFn.mock.calls.length).toBe(2); | ||
}); | ||
``` | ||
#### In Browser (ESM) | ||
@@ -66,0 +87,0 @@ ```html |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
89894
0
159
0