Skip to content

Commit 1f196a0

Browse files
Refactor test runner (#3234)
1 parent b399799 commit 1f196a0

61 files changed

Lines changed: 146 additions & 221 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
{
1616
"label": "Build extension and tests",
17-
"dependsOn": ["Build extension", "Build test harness"],
17+
"dependsOn": ["Build extension", "Build test runner"],
1818
"group": "build"
1919
},
2020
{
@@ -29,7 +29,7 @@
2929

3030
// Helper tasks
3131
{
32-
"label": "Build test harness",
32+
"label": "Build test runner",
3333
"type": "npm",
3434
"script": "build",
3535
"path": "packages/test-runner",

cursorless.nvim/lua/cursorless/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ local function register_functions()
3939
vim.fn["remote#host#RegisterPlugin"]("node", path .. "/node/test-runner/", {
4040
{
4141
type = "function",
42-
name = "TestHarnessRun",
42+
name = "TestRunnerRun",
4343
sync = false,
4444
opts = vim.empty_dict(),
4545
},
@@ -55,7 +55,7 @@ local function load_extensions()
5555
if os.getenv("CURSORLESS_MODE") == "test" then
5656
-- make sure cursorless is loaded before starting the tests
5757
vim.uv.sleep(1000)
58-
vim.fn.TestHarnessRun()
58+
vim.fn.TestRunnerRun()
5959
else
6060
vim.fn.CommandServerLoadExtension()
6161
end

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
"build": "pnpm -r build",
1313
"clean": "pnpm -r clean",
1414
"typecheck": "pnpm -r typecheck",
15-
"fix:prettier": "prettier --write --list-different .",
1615
"lint:meta": "pnpm run meta-updater --test",
1716
"lint:syncpack": "syncpack lint",
1817
"lint:ts": "eslint packages",
19-
"lint:prettier": "prettier --check .",
2018
"lint:style": "stylelint '**/*.{css,scss}' --ignore-path .gitignore",
19+
"lint:fmt": "prettier --check .",
2120
"lint": "pnpm run typecheck && pnpm run lint:meta && pnpm run lint:syncpack && pnpm run lint:ts && pnpm run lint:style",
2221
"fix:meta": "pnpm run meta-updater && pnpm -r exec prettier --write tsconfig.json package.json",
2322
"fix:syncpack": "syncpack fix",
2423
"fix:eslint": "pnpm lint:ts --fix",
2524
"fix:style": "stylelint '**/*.{css,scss}' --ignore-path .gitignore --fix",
25+
"fix:fmt": "prettier --write --list-different .",
2626
"init-vscode-sandbox": "pnpm -F @cursorless/app-vscode init-launch-sandbox",
2727
"meta-updater": "env NODE_OPTIONS=--import=tsx meta-updater",
2828
"preinstall": "npx only-allow pnpm",

packages/app-neovim/scripts/populate-dist.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88
echo "CURSORLESS_REPO_ROOT: $CURSORLESS_REPO_ROOT"
99
cursorless_nvim_dir="$CURSORLESS_REPO_ROOT/cursorless.nvim"
1010
cursorless_neovim_node_in_dir="$CURSORLESS_REPO_ROOT/packages/app-neovim"
11-
test_harness_node_in_dir="$CURSORLESS_REPO_ROOT/packages/test-runner"
11+
test_runner_node_in_dir="$CURSORLESS_REPO_ROOT/packages/test-runner"
1212

1313
if [[ "${CI:-x}" == "true" ]]; then
1414
# If running in CI, only copy the necessary files for testing and release
@@ -25,10 +25,10 @@ if [[ "${CI:-x}" == "true" ]]; then
2525
cp "$cursorless_neovim_node_in_dir/out/index.cjs" "$cursorless_neovim_node_out_dir/out"
2626

2727
# Populate test-runner
28-
test_harness_node_out_dir="$cursorless_nvim_dist_dir/node/test-runner"
29-
mkdir -p "$test_harness_node_out_dir/out"
30-
cp "$test_harness_node_in_dir/package.json" "$test_harness_node_out_dir"
31-
cp "$test_harness_node_in_dir/out/extensionTestsNeovim.cjs" "$test_harness_node_out_dir/out"
28+
test_runner_node_out_dir="$cursorless_nvim_dist_dir/node/test-runner"
29+
mkdir -p "$test_runner_node_out_dir/out"
30+
cp "$test_runner_node_in_dir/package.json" "$test_runner_node_out_dir"
31+
cp "$test_runner_node_in_dir/out/extensionTestsNeovim.cjs" "$test_runner_node_out_dir/out"
3232
else
3333
# Symlink so we inherit the .map files as well, but only if uname doesn't
3434
# start with "MINGW" (Windows Git Bash)
@@ -43,8 +43,8 @@ else
4343
rm -rf "$cursorless_neovim_node_out_dir"
4444
ln -s "$cursorless_neovim_node_in_dir" "$cursorless_neovim_node_out_dir"
4545

46-
test_harness_node_out_dir="$cursorless_nvim_dir/node/test-runner"
47-
rm -rf "$test_harness_node_out_dir"
48-
ln -s "$test_harness_node_in_dir" "$test_harness_node_out_dir"
46+
test_runner_node_out_dir="$cursorless_nvim_dir/node/test-runner"
47+
rm -rf "$test_runner_node_out_dir"
48+
ln -s "$test_runner_node_in_dir" "$test_runner_node_out_dir"
4949
fi
5050
fi
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@cursorless/app-talon",
2+
"name": "@cursorless/app-talonjs",
33
"version": "1.0.0",
44
"description": "cursorless in talon js",
55
"license": "MIT",
@@ -18,6 +18,6 @@
1818
},
1919
"dependencies": {
2020
"@cursorless/lib-common": "workspace:*",
21-
"@cursorless/lib-talon-core": "workspace:*"
21+
"@cursorless/lib-talonjs-core": "workspace:*"
2222
}
2323
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { RunMode } from "@cursorless/lib-common";
2-
import { activate as activateCore } from "@cursorless/lib-talon-core";
2+
import { activate as activateCore } from "@cursorless/lib-talonjs-core";
33
import * as talon from "talon";
44

55
export async function activate(runMode: RunMode): Promise<void> {
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare module "talon" {
33
TalonActions,
44
TalonContextConstructor,
55
TalonSettings,
6-
} from "@cursorless/lib-talon-core";
6+
} from "@cursorless/lib-talonjs-core";
77

88
export const actions: TalonActions;
99
export const settings: TalonSettings;

0 commit comments

Comments
 (0)