Skip to content

Commit 6aef40a

Browse files
Clean up snippet test
1 parent 8d2d5ba commit 6aef40a

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

packages/lib-engine/src/test/fixtures/communitySnippets.fixture.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,10 @@ const snippetAfterAction: ActionDescriptor = {
1717
},
1818
snippetDescription: {
1919
type: "list",
20-
// This will be the current active language
21-
fallbackLanguage: "typescript",
2220
snippets: [
2321
{
2422
type: "custom",
25-
languages: [
26-
"javascript",
27-
"typescript",
28-
"javascriptreact",
29-
"typescriptreact",
30-
],
31-
body: 'import * as $0 from "$0";',
23+
body: "```$0\n$1\n```",
3224
},
3325
],
3426
},
@@ -40,5 +32,5 @@ const snippetAfterAction: ActionDescriptor = {
4032
* Talon tests by relying on our recorded test fixtures alone.
4133
*/
4234
export const communitySnippetsSpokenFormsFixture = [
43-
spokenFormTest("snip import star after air", snippetAfterAction, undefined),
35+
spokenFormTest("snip code after air", snippetAfterAction, undefined),
4436
];

packages/test-runner/src/runAllTests.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,28 @@ export function runAllTests(type: TestType): Promise<void> {
3434
const testRoot = path.join(getCursorlessRepoRoot(), "packages");
3535

3636
let filePattern: string;
37-
let ignore: string[] | undefined;
38-
39-
if (type === TestType.unit) {
40-
filePattern = "test.ts";
41-
ignore = [
42-
TestType.vscode,
43-
TestType.talon,
44-
TestType.talonJs,
45-
TestType.neovim,
46-
].map((t) => `**/*.${t}.ts`);
47-
} else {
48-
filePattern = `${type}.cjs`;
49-
ignore = undefined;
37+
let ignore: string[] | undefined = undefined;
38+
39+
switch (type) {
40+
case TestType.unit:
41+
filePattern = "test.ts";
42+
ignore = [
43+
TestType.vscode,
44+
TestType.talon,
45+
TestType.talonJs,
46+
TestType.neovim,
47+
].map((t) => `**/*.${t}.ts`);
48+
break;
49+
50+
case TestType.talon:
51+
case TestType.talonJs:
52+
filePattern = `${type}.ts`;
53+
break;
54+
55+
// These tests have to be .cjs files because they import vscode and neovim modules which don't work with ts files
56+
case TestType.vscode:
57+
case TestType.neovim:
58+
filePattern = `${type}.cjs`;
5059
}
5160

5261
return runTestsInDir(testRoot, filePattern, ignore);

0 commit comments

Comments
 (0)