Skip to content

Why are Mocha tests each run as a separate suite? #1157

@ozyx

Description

@ozyx

I have multiple Mocha test suites in the same NTVS project. When I run the tests in this project from Test Explorer by right clicking and selecting 'Run All Tests', each test is run as its own test suite. Is this by design or is there a way to control how VS runs the test? This same behavior occurs when running the tests as part of a TFS build.

Please let me know if you need me to elaborate on anything.
Thanks!

Expected Behavior

before()
run test 1
run test 2
run test 3
after()

Actual Behavior

before()
run test 1
after()
before()
run test 2
after()
before()
run test 3
after()

  • NTVS Version: 1.1
  • Visual Studio Version: 2013 Professional Update 5
  • Node.js Version: 4.4.7
Steps to Reproduce
  1. Create simple Mocha test suite with multiple tests and before() and after()
  2. Right click on project in Test Explorer and select 'Run All Tests'
  3. Observer that before() and after() are called for each test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions