Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codelens near mocha keywords #42

Merged
merged 5 commits into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.0] - 2019-09-27

### Fixed

- Fix integrated terminal instances bug.

### Added

- Add `suite`, `context` and `specify` keywords to test token list.

## [1.3.0] - 2019-09-08

### Added
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@
</a>
</p>

Testify is a JavaScript and Typescript test runner extension for VSCode. It adds codelens near `describe`, `it`, and `test` keywords enabling VSCode to run associated tests and output the results in the integrated terminal.
Testify is a JavaScript and Typescript test runner extension for VSCode. It adds codelens near the framework's keywords, such as
- `suite`,
- `describe`,
- `context`,
- `it`,
- `specify`
- `test`

enabling VSCode to run associated tests and output the results in the integrated terminal.
Currently it works **out of the box** for **Mocha** and **Jest** test runner.

## Demo
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "testify",
"displayName": "Testify",
"version": "1.3.0",
"version": "1.4.0",
"author": {
"name": "felixjb"
},
"publisher": "felixjb",
"description": "Run JavaScript tests easily using CodeLens",
"description": "Run JavaScript & TypeScript tests easily using CodeLens",
"license": "MIT",
"categories": [
"Other"
Expand Down
2 changes: 1 addition & 1 deletion src/parser/codeParser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse, ParserOptions } from "@babel/parser";

const testTokens = ["describe", "it", "test"];
const testTokens = ["suite", "describe", "context", "it", "specify", "test"];
felixjb marked this conversation as resolved.
Show resolved Hide resolved

function codeParser(sourceCode) {
const parserOptions: ParserOptions = {
Expand Down
3 changes: 2 additions & 1 deletion src/runners/TestRunnerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { TerminalProvider } from "../providers/TerminalProvider";
import { JestTestRunner } from "./JestTestRunner";
import { MochaTestRunner } from "./MochaTestRunner";

const terminalProvider = new TerminalProvider();

function doesFileExist(filePath: string): Promise<boolean> {
return new Promise(resolve => {
exists(filePath, doesExist => {
Expand Down Expand Up @@ -54,7 +56,6 @@ async function getAvailableTestRunner(
export async function getTestRunner(
rootPath: WorkspaceFolder
): Promise<ITestRunnerInterface> {
const terminalProvider = new TerminalProvider();
const configurationProvider = new ConfigurationProvider(rootPath);
const customTestRunnerPath = configurationProvider.testRunnerPath;

Expand Down