microsoft / microsoft/nodejstools

Callback not working for tests

Open
#1,943 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

test-adapter
Dominant language
C#
Stars
1.8k
Forks
355
PR merge metrics
No merged PRs in 30d

Description

The test is not able to handle callbacks properly. Callback in never executed.

exports['AddvertexTest'] = function () {
    addVertex();
}

function addVertex() {
    console.log('Running Add Vertex1');
    client.execute("g.addV('person').property('id', 'thomas').property('firstName', 'Thomas').property('age', 44).property('userid', 1)", {}, (err, results) => {
        **if (err) {
            assert.ok(false, "Vertex adition failed");
        }

        console.log("Result: %s\n", JSON.stringify(results));
        assert.ok(true, "Vertex adition Successful!!");**
    });
}

dropVertex() and addVertex() execute request asynchronously with callbacks. The tests does not execute the callback.

Expected Behavior

Execute callback

Actual Behavior

Callback not executed.

  • NTVS Version: 1.3
  • Visual Studio Version: 2015
  • Node.js Version:
Steps to Reproduce
  1. Add test with callbacks
  2. run the test.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report's entry point is the supplied AddvertexTest/addVertex reproduction; first run it in the stated NTVS 1.3 and Visual Studio 2015 context and inspect whether the asynchronous request reaches its callback. Done means the callback executes and the success or failure assertions behave as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.