Variable 'wrapper' should be initialized on declaration.
32};
33
34describe("if props are correctly passed", () => {
35 let wrapper;36 beforeEach(() => {
37 wrapper = setup();
38 });
Variable 'wrapper' should be initialized on declaration.
37});
38
39describe("if props are correctly passed", () => {
40 let wrapper;41 beforeEach(() => {
42 wrapper = setup();
43 });
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.
77});
78
79describe("select component input text box events", () => {
80 let wrapper, customSelectInputBox, inputbox; 81 beforeEach(() => {
82 wrapper = setup();
83 customSelectInputBox = findByTestAttr(wrapper, "custom-select-input-box");
Variable 'customSelectInputBox' should be initialized on declaration.
77});
78
79describe("select component input text box events", () => {
80 let wrapper, customSelectInputBox, inputbox; 81 beforeEach(() => {
82 wrapper = setup();
83 customSelectInputBox = findByTestAttr(wrapper, "custom-select-input-box");
Variable 'inputbox' should be initialized on declaration.
77});
78
79describe("select component input text box events", () => {
80 let wrapper, customSelectInputBox, inputbox; 81 beforeEach(() => {
82 wrapper = setup();
83 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;
}