Variable 'wrapper' should be initialized on declaration
29}
30
31describe('if props are correctly passed', () => {
32 let wrapper;33 beforeEach(() => {
34 wrapper = setup();
35 });
Variable 'wrapper' should be initialized on declaration
34});
35
36describe('if props are correctly passed', () => {
37 let wrapper;38 beforeEach(() => {
39 wrapper = setup();
40 });
Variable 'wrapper' should be initialized on declaration
65});
66
67describe('select component input text box events', () => {
68 let wrapper, customSelectInputBox, inputbox; 69 beforeEach(() => {
70 wrapper = setup();
71 customSelectInputBox = findByTestAttr(wrapper, 'custom-select-input-box');
Variable 'customSelectInputBox' should be initialized on declaration
65});
66
67describe('select component input text box events', () => {
68 let wrapper, customSelectInputBox, inputbox; 69 beforeEach(() => {
70 wrapper = setup();
71 customSelectInputBox = findByTestAttr(wrapper, 'custom-select-input-box');
Variable 'wrapper' should be initialized on declaration
31}
32
33describe('if props are correctly passed', () => {
34 let wrapper; 35 beforeEach(() => {
36 wrapper = setup();
37 });
Variable 'inputbox' should be initialized on declaration
65});
66
67describe('select component input text box events', () => {
68 let wrapper, customSelectInputBox, inputbox; 69 beforeEach(() => {
70 wrapper = setup();
71 customSelectInputBox = findByTestAttr(wrapper, 'custom-select-input-box');
Description
In JavaScript, variables can be assigned during declaration, or at any point afterwards using an assignment statement. For example, in the following code, foo
is initialized during declaration, while bar
is initialized later.
var foo = 1;
var bar;
if (foo) {
bar = 1;
} else {
bar = 2;
}
Bad Practice
function foo() {
var bar;
let baz;
}
Recommended
function foo() {
var bar = 1;
let baz = 2;
const qux = 3;
}