Skip to content

SEatSFU/JScope

Repository files navigation

JScope – Javascript Async Coverage VScode Extension

Getting Started

You can either try out a dockerized version of JScope (Recommended), limited to its CLI-only version by following INSTALL.md. You may also be able to run the full VScode extension using a VScode extension like this one, that provides the ability to develop inside a container.

Or you can follow the guide below to install the dependencies on your own machine and then run JScope.

  1. Install global dependencies. To use JScope, you need these installed on your machine:

  2. Configuration

    • Open src/jscope-config.json and set nodeprof_path to the directory of nodeprof you installed from step 1.
    • Open instrumentation/nodeprof.sh and update javaHome variable to point to a GraalVM-compatible version. You either had it installed on your machine, or freshly installed another version, updated javaHome variable accordingly. You should also add path/to/mx directory to your path in the same file.
  3. Compile.

    • Run npm run build to install packages used in JScope, and compile the typescript project.

Running JScope in debug mode

After building the project, you can run JSCope by clicking on the "Run extension" button from the "Run and debug" panel in VSCode. (You can also use the F5 shortcut as well)

Step1

Step2

A new VSCode window will appears, which has JScope installed.

To measure coverage for any repository, it should be added to the current VSCode workspace, right click on the side panel, click "Add Folder to Workspace" and add your desired node.js project.

Step3

Now select the P icon on the primary sidebar. It should open Jscope's menu.

Step4

Before running JScope on any project, create a jscope.json file in the top level directory of the repository. Fill in the jscope.json using the sample provided in src/jsope.json.sample.

If a jscope.json file does not exist, JScope will use the default configuration for a project as defined in src/jscope-config.json. It may fail to work properly if the test framework or test regex are not correctly defined for the project under test.

Now you can select the "New Coverage" Button, and select a project from the drop-down menu that appears. Wait until instrumentation and calculation of the coverage. You can also see the logs in the debug console.

For researchers and maintainers.

  • See Developer's guide if you want to build, test, or extend JScope. Contains information about the components of JScope.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published