-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: happy path for downloading Next LS (#77)
- Loading branch information
Showing
10 changed files
with
395 additions
and
767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
test: | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
os: [macos-14, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
|
@@ -33,7 +33,7 @@ jobs: | |
node-version: 16.x | ||
cache: 'yarn' | ||
- run: yarn install --immutable | ||
- run: xvfb-run -a yarn test | ||
if: runner.os == 'Linux' | ||
- run: yarn test | ||
if: runner.os != 'Linux' | ||
- name: Run headless test | ||
uses: GabrielBB/[email protected] | ||
with: | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ dist | |
node_modules | ||
.vscode-test/ | ||
*.vsix | ||
test-bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
import * as assert from "assert"; | ||
import * as fs from "fs"; | ||
import * as path from "path"; | ||
|
||
// You can import and use all API from the 'vscode' module | ||
// as well as import your extension to test it | ||
import * as vscode from "vscode"; | ||
// import * as myExtension from '../../extension'; | ||
import * as myExtension from "../../extension.js"; | ||
import * as sinon from "sinon"; | ||
|
||
suite("Extension Test Suite", () => { | ||
vscode.window.showInformationMessage("Start all tests."); | ||
|
||
test("Sample test", () => { | ||
assert.strictEqual(-1, [1, 2, 3].indexOf(5)); | ||
assert.strictEqual(-1, [1, 2, 3].indexOf(0)); | ||
setup(function () { | ||
fs.rmSync("./test-bin", { recursive: true, force: true }); | ||
sinon.stub(vscode.window, "showInformationMessage").returns( | ||
new Promise((resolve) => { | ||
return resolve({ title: "Yes" }); | ||
}) | ||
); | ||
}); | ||
|
||
teardown(function () { | ||
sinon.restore(); | ||
}); | ||
|
||
test("downloads Next LS", async function () { | ||
fs.mkdirSync("./test-bin", { recursive: true }); | ||
|
||
let result = await myExtension.ensureNextLSDownloaded("test-bin"); | ||
assert.equal(path.normalize(result), path.normalize("test-bin/nextls")); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "ES2020", | ||
"lib": [ | ||
"ES2020", "DOM" | ||
], | ||
"sourceMap": true, | ||
"rootDir": "src", | ||
"strict": true /* enable all strict type-checking options */ | ||
/* Additional Checks */ | ||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ | ||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ | ||
// "noUnusedParameters": true, /* Report errors on unused parameters. */ | ||
} | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "commonjs", | ||
"lib": ["ES2020", "DOM"], | ||
"outDir": "out", | ||
"sourceMap": true, | ||
"strict": false | ||
}, | ||
"exclude": ["node_modules", ".vscode-test", ] | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.