0

I'm performing some behaviour tests with Jasmine and the following variables are getting these annoying tips under the word—totally unnecessary, since they're being defined on beforeEach(); scope.

Look:

Demo 1

I know what Microsoft is trying to achieve and until it get polished enough I want to disable this kind of tips/hints. How can I do this?

This is what VSCode is suggesting to throw away that green lines:

Deom 2

If I select any of the options, it works—but unfortunately any of that options are suitable on my scenario.

Ideas?

1 Answer 1

1

There is currently no option to turn off the code actions. I created an item for this in the VSCode issue database.

However, in your case, can't you add a 'var dataMatrix;' in a scope that is parent to the test function as well as the 'beforeEach' function? Or if the variable is really meant to be global, the "Mark 'dataMatrix' as global" action sounds like the right thing to do.

describe("A spec with setup", function() {
    var dataMatrix;

    beforeEach(function() {
        dataMatrix= [0,0];
    });

    it("my test", function() {
        expect(dataMatrix).toEqual([1,1]);
    });
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.