Skip to content

Commit

Permalink
test: it seems to happen around svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Apr 23, 2024
1 parent 9c14477 commit eef647d
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 234 deletions.
27 changes: 0 additions & 27 deletions vscode-extension/test/e2e/runTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,6 @@ async function main() {
);
}

childProcess.spawnSync(
cli,
[...args, "--install-extension", "octref.vetur"],
{
encoding: "utf-8",
stdio: "inherit",
},
);

childProcess.spawnSync(
cli,
[...args, "--install-extension", "svelte.svelte-vscode"],
{
encoding: "utf-8",
stdio: "inherit",
},
);

childProcess.spawnSync(
cli,
[...args, "--install-extension", "astro-build.astro-vscode"],
{
encoding: "utf-8",
stdio: "inherit",
},
);

await runTests({
vscodeExecutablePath,
version,
Expand Down
129 changes: 0 additions & 129 deletions vscode-extension/test/e2e/suite/completion/completion.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ const { testCompletion } = require("./helper");
describe("SCSS Completion Test", function () {
const docUri = getDocUri("completion/main.scss");
const modulesDocUri = getDocUri("completion/modules.scss");
const vueDocUri = getDocUri("completion/AppButton.vue");
const svelteDocUri = getDocUri("completion/AppButton.svelte");
const astroDocUri = getDocUri("completion/AppButton.astro");

before(async () => {
await showFile(docUri);
await showFile(vueDocUri);
await showFile(svelteDocUri);
await showFile(astroDocUri);
await sleepCI();
});

Expand Down Expand Up @@ -65,26 +59,12 @@ describe("SCSS Completion Test", function () {
},
];
await testCompletion(docUri, position(11, 11), expectedCompletions);
await testCompletion(svelteDocUri, position(14, 11), expectedCompletions);

// For Vue and Astro, the existing $ is not replaced by VS Code, so omit it from insertText
expectedCompletions = [
{
label: "$tilde",
insertText: '"tilde"',
},
];
await testCompletion(vueDocUri, position(22, 11), expectedCompletions);
await testCompletion(astroDocUri, position(17, 11), expectedCompletions);
});

it("Offers completions from partial file", async () => {
const expectedCompletions = [{ label: "$partial" }];

await testCompletion(docUri, position(17, 11), expectedCompletions);
await testCompletion(vueDocUri, position(28, 11), expectedCompletions);
await testCompletion(svelteDocUri, position(20, 11), expectedCompletions);
await testCompletion(astroDocUri, position(23, 11), expectedCompletions);
});

it("Offers namespaces completions including prefixes", async () => {
Expand All @@ -102,24 +82,6 @@ describe("SCSS Completion Test", function () {

await testCompletion(docUri, position(23, 13), expectedCompletions);

// For Vue, Svelte and Astro, the existing . from the namespace is not replaced by VS Code, so omit them from insertText.
// However, we still need them both in the filter text.
expectedCompletions = [
{
label: "$var-var-variable",
insertText: '"$var-var-variable"',
filterText: '"ns.$var-var-variable"',
},
{
label: "fun-fun-function",
insertText: '"fun-fun-function()"',
},
];

await testCompletion(vueDocUri, position(34, 13), expectedCompletions);
await testCompletion(svelteDocUri, position(26, 13), expectedCompletions);
await testCompletion(astroDocUri, position(29, 13), expectedCompletions);

expectedCompletions = [
{
label: "mix-mix-mixin",
Expand All @@ -128,18 +90,6 @@ describe("SCSS Completion Test", function () {
];

await testCompletion(docUri, position(24, 15), expectedCompletions);

// Same as for functions with regards to the . from the namespace.
expectedCompletions = [
{
label: "mix-mix-mixin",
insertText: '"mix-mix-mixin"',
},
];

await testCompletion(vueDocUri, position(35, 15), expectedCompletions);
await testCompletion(svelteDocUri, position(27, 15), expectedCompletions);
await testCompletion(astroDocUri, position(30, 15), expectedCompletions);
});

// We can't test this until somesass.suggestOnlyFromUse: true becomes the default setting
Expand All @@ -149,15 +99,6 @@ describe("SCSS Completion Test", function () {
await testCompletion(docUri, position(23, 13), expectedCompletions, {
expectNoMatch: true,
});
await testCompletion(vueDocUri, position(34, 13), expectedCompletions, {
expectNoMatch: true,
});
await testCompletion(svelteDocUri, position(26, 13), expectedCompletions, {
expectNoMatch: true,
});
await testCompletion(astroDocUri, position(29, 13), expectedCompletions, {
expectNoMatch: true,
});

expectedCompletions = [
"secret",
Expand All @@ -169,44 +110,6 @@ describe("SCSS Completion Test", function () {
await testCompletion(docUri, position(24, 15), expectedCompletions, {
expectNoMatch: true,
});
await testCompletion(vueDocUri, position(35, 15), expectedCompletions, {
expectNoMatch: true,
});
await testCompletion(svelteDocUri, position(27, 15), expectedCompletions, {
expectNoMatch: true,
});
await testCompletion(astroDocUri, position(30, 15), expectedCompletions, {
expectNoMatch: true,
});
});

it("Offers no completions on Vuelike file outside SCSS regions", async () => {
await testCompletion(vueDocUri, position(2, 9), []);
await testCompletion(vueDocUri, position(6, 8), []);
await testCompletion(svelteDocUri, position(1, 16), []);
await testCompletion(astroDocUri, position(4, 16), []);
});

it("Offers variable completions on Vuelike file", async () => {
// In Vue and Astro files:
// For variables _without_ a namespace ($color as opposed to namespace.$color),
// VS Code does not replace the existing $ when using the completion.
// The insertText must be without one to avoid $$color. However, filterText
// still need the $ sign for the suggestion to match.
let expectedCompletions = [
{ label: "$color", insertText: '"color"' },
{ label: "$fonts", insertText: '"fonts"' },
];

await testCompletion(vueDocUri, position(16, 11), expectedCompletions);
await testCompletion(astroDocUri, position(11, 11), expectedCompletions);

expectedCompletions = [
{ label: "$color", insertText: '"$color"' },
{ label: "$fonts", insertText: '"$fonts"' },
];

await testCompletion(svelteDocUri, position(8, 11), expectedCompletions);
});

it("Offers namespace completion inside string interpolation", async () => {
Expand All @@ -223,24 +126,6 @@ describe("SCSS Completion Test", function () {
];

await testCompletion(docUri, position(25, 40), expectedCompletions);

// For Vue, Svelte and Astro, the existing . from the namespace is not replaced by VS Code, so omit them from insertText.
// However, we still need them both in the filter text.
expectedCompletions = [
{
label: "$var-var-variable",
insertText: '"$var-var-variable"',
filterText: '"ns.$var-var-variable"',
},
{
label: "fun-fun-function",
insertText: '"fun-fun-function()"',
},
];

await testCompletion(vueDocUri, position(36, 40), expectedCompletions);
await testCompletion(svelteDocUri, position(28, 40), expectedCompletions);
await testCompletion(astroDocUri, position(31, 40), expectedCompletions);
});

it("Offers completions for Sass built-ins", async () => {
Expand All @@ -253,20 +138,6 @@ describe("SCSS Completion Test", function () {
];

await testCompletion(docUri, position(36, 19), expectedCompletions);

// For Vue, Svelte and Astro, the existing . from the namespace is not replaced by VS Code, so omit them from insertText.
// However, we still need them both in the filter text.
expectedCompletions = [
{
label: "floor",
insertText: '"floor(${1:number})"',
filterText: '"math.floor"',
},
];

await testCompletion(vueDocUri, position(42, 19), expectedCompletions);
await testCompletion(svelteDocUri, position(34, 19), expectedCompletions);
await testCompletion(astroDocUri, position(37, 19), expectedCompletions);
});

it("Offers namespace completion inside string interpolation with preceeding non-space character", async () => {
Expand Down
21 changes: 0 additions & 21 deletions vscode-extension/test/e2e/suite/definition/definitions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ const { testDefinition } = require("./helper");

describe("SCSS Definition Test", function () {
const docUri = getDocUri("definition/main.scss");
const vueDocUri = getDocUri("definition/AppButton.vue");
const svelteDocUri = getDocUri("definition/AppButton.svelte");
const astroDocUri = getDocUri("definition/AppButton.astro");

before(async () => {
await showFile(docUri);
await showFile(vueDocUri);
await showFile(svelteDocUri);
await showFile(astroDocUri);
await sleepCI();
});

Expand All @@ -26,29 +20,20 @@ describe("SCSS Definition Test", function () {
const expectedLocation = sameLineLocation(expectedDocumentUri, 1, 1, 10);

await testDefinition(docUri, position(7, 13), expectedLocation);
await testDefinition(vueDocUri, position(15, 13), expectedLocation);
await testDefinition(svelteDocUri, position(9, 15), expectedLocation);
await testDefinition(astroDocUri, position(12, 15), expectedLocation);
});

it("should find definition for functions", async () => {
const expectedDocumentUri = getDocUri("_functions.scss");
const expectedLocation = sameLineLocation(expectedDocumentUri, 1, 11, 19);

await testDefinition(docUri, position(7, 24), expectedLocation);
await testDefinition(vueDocUri, position(15, 24), expectedLocation);
await testDefinition(svelteDocUri, position(9, 26), expectedLocation);
await testDefinition(astroDocUri, position(12, 26), expectedLocation);
});

it("should find definition for mixins", async () => {
const expectedDocumentUri = getDocUri("_mixins.scss");
const expectedLocation = sameLineLocation(expectedDocumentUri, 1, 8, 13);

await testDefinition(docUri, position(9, 12), expectedLocation);
await testDefinition(vueDocUri, position(17, 12), expectedLocation);
await testDefinition(svelteDocUri, position(11, 14), expectedLocation);
await testDefinition(astroDocUri, position(14, 14), expectedLocation);
});

it("should find definition for placeholder", async () => {
Expand All @@ -63,18 +48,12 @@ describe("SCSS Definition Test", function () {
const expectedLocation = sameLineLocation(expectedDocumentUri, 1, 1, 18);

await testDefinition(docUri, position(15, 14), expectedLocation);
await testDefinition(vueDocUri, position(23, 14), expectedLocation);
await testDefinition(svelteDocUri, position(17, 14), expectedLocation);
await testDefinition(astroDocUri, position(20, 14), expectedLocation);
});

it("should find symbol definition behind namespace and prefix", async () => {
const expectedDocumentUri = getDocUri("namespace/_mixins.scss");
const expectedLocation = sameLineLocation(expectedDocumentUri, 1, 8, 17);

await testDefinition(docUri, position(16, 17), expectedLocation);
await testDefinition(vueDocUri, position(24, 17), expectedLocation);
await testDefinition(svelteDocUri, position(18, 17), expectedLocation);
await testDefinition(astroDocUri, position(21, 17), expectedLocation);
});
});
21 changes: 0 additions & 21 deletions vscode-extension/test/e2e/suite/hover/hover.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ const { testHover } = require("./helper");
describe("SCSS Hover Test", function () {
const docUri = getDocUri("hover/main.scss");
const collisionUri = getDocUri("hover/collision.scss");
const vueDocUri = getDocUri("hover/AppButton.vue");
const svelteDocUri = getDocUri("hover/AppButton.svelte");
const astroDocUri = getDocUri("hover/AppButton.astro");

before(async () => {
await showFile(docUri);
await showFile(collisionUri);
await showFile(vueDocUri);
await showFile(svelteDocUri);
await showFile(astroDocUri);
await sleepCI();
});

Expand All @@ -25,9 +19,6 @@ describe("SCSS Hover Test", function () {
};

await testHover(docUri, position(7, 13), expectedContents);
await testHover(vueDocUri, position(15, 13), expectedContents);
await testHover(svelteDocUri, position(9, 15), expectedContents);
await testHover(astroDocUri, position(12, 15), expectedContents);
});

it("shows hover for functions", async () => {
Expand All @@ -38,9 +29,6 @@ describe("SCSS Hover Test", function () {
};

await testHover(docUri, position(7, 24), expectedContents);
await testHover(vueDocUri, position(15, 24), expectedContents);
await testHover(svelteDocUri, position(9, 26), expectedContents);
await testHover(astroDocUri, position(12, 26), expectedContents);
});

it("shows hover for mixins", async () => {
Expand All @@ -51,9 +39,6 @@ describe("SCSS Hover Test", function () {
};

await testHover(docUri, position(9, 12), expectedContents);
await testHover(vueDocUri, position(17, 12), expectedContents);
await testHover(svelteDocUri, position(11, 14), expectedContents);
await testHover(astroDocUri, position(14, 14), expectedContents);
});

it("shows hover for placeholders", async () => {
Expand All @@ -74,9 +59,6 @@ describe("SCSS Hover Test", function () {
};

await testHover(docUri, position(15, 14), expectedContents);
await testHover(vueDocUri, position(23, 14), expectedContents);
await testHover(svelteDocUri, position(17, 14), expectedContents);
await testHover(astroDocUri, position(20, 14), expectedContents);
});

it("shows hover for symbol behind namespace and prefix", async () => {
Expand All @@ -88,9 +70,6 @@ describe("SCSS Hover Test", function () {
};

await testHover(docUri, position(16, 17), expectedContents);
await testHover(vueDocUri, position(24, 17), expectedContents);
await testHover(svelteDocUri, position(18, 17), expectedContents);
await testHover(astroDocUri, position(21, 17), expectedContents);
});

it("shows hover for SassDoc annotations", async () => {
Expand Down
Loading

0 comments on commit eef647d

Please sign in to comment.