jstestadapter is a JavaScript test adapter extension for Visual Studio Test Platform. jstest with vstest can be used as a command line tool to run tests written in mocha, jasmine or jest.
Install
npm install --save-dev jstestadapter
Usage
# Testing with default test framework, Jasmine
path/to/vstest.console.exe --TestAdapterPath:./node_modules/jstestadapter/ path/to/test.1.js path/to/test.2.js
# Testing with Mocha
path/to/vstest.console.exe --TestAdapterPath:./node_modules/jstestadapter/ path/to/test.1.js path/to/test.2.js -- JSTest.TestFramework=Mocha
# Running tests with jest
path/to/vstest.console.exe --TestAdapterPath:./node_modules/jstestadapter/ path/to/package.json -- JSTest.TestFramework=Jest
RunSettings Configuration
Option
Usage
Default
TestFramework
One of the following test frameworks for execution: Jasmine/Mocha/Jest
Jasmine
DebugLogs
Enable debug logs for JavaScript test runner
false
DebugFilePath
Path for diagnostic logs
""
TestFrameworkConfigJson
Override test framework configurations (Specific to the testframework) in json format
{}
RunSettings can be provided through the the vstest cli itself: