52 it('should check for socketStatus when connection is terminated', () => {
53 const mockStreamingclient = {
54 startStreaming: jest.fn(),
55 connect: jest.fn((url, language, onConnect) => {56 jest.fn()
57 }),
58 stopStreaming: jest.fn(),
12 it('should check for startstreaming and connect functions of streamingClient when handledStart is called', () => {
13 const mockStreamingclient = {
14 startStreaming: jest.fn(),
15 connect: jest.fn((url, language, onConnect) => {16 jest.fn()
17 }),
18 stopStreaming: jest.fn(),
12 it('should check for startstreaming and connect functions of streamingClient when handledStart is called', () => {
13 const mockStreamingclient = {
14 startStreaming: jest.fn(),
15 connect: jest.fn((url, language, onConnect) => {16 jest.fn()
17 }),
18 stopStreaming: jest.fn(),
81 it('should check for stopstreaming function when handledStop is called', () => {
82 const mockStreamingclient = {
83 startStreaming: jest.fn(),
84 connect: jest.fn((url, language, onConnect) => {85 jest.fn()
86 }),
87 stopStreaming: jest.fn(),
81 it('should check for stopstreaming function when handledStop is called', () => {
82 const mockStreamingclient = {
83 startStreaming: jest.fn(),
84 connect: jest.fn((url, language, onConnect) => {85 jest.fn()
86 }),
87 stopStreaming: jest.fn(),
Unused variables are generally considered a code smell and should be avoided.
Removing unused references - It prevents unused modules from being loaded at runtime, improving performance, and preventing the compiler from loading metadata that will never be used. - It prevents conflicts that may occur when trying to reference another variable.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
import fs from 'fs' // <- unused
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)