-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
broccolirob
committed
Mar 8, 2023
1 parent
d8576f1
commit 98ff5d8
Showing
6 changed files
with
69 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as path from "path"; | ||
import * as Mocha from "mocha"; | ||
import * as glob from "glob"; | ||
|
||
export function run(): Promise<void> { | ||
const mocha = new Mocha({ ui: "tdd", color: true }); | ||
const testsRoot = path.resolve(__dirname, ".."); | ||
|
||
return new Promise((c, e) => { | ||
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => { | ||
if (err) { | ||
return e(err); | ||
} | ||
|
||
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f))); | ||
|
||
try { | ||
mocha.run((failures) => { | ||
if (failures > 0) { | ||
e(new Error(`${failures} tests failed.`)); | ||
} else { | ||
c(); | ||
} | ||
}); | ||
} catch (err) { | ||
console.error(err); | ||
e(err); | ||
} | ||
}); | ||
}); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as assert from "assert"; | ||
|
||
import * as vscode from "vscode"; | ||
|
||
suite("Slither-VSCode Test Suite", () => { | ||
vscode.window.showInformationMessage("Start all tests."); | ||
|
||
test("example test", () => { | ||
assert(true, "Somehow this failed"); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as path from "path"; | ||
|
||
import { runTests } from "@vscode/test-electron"; | ||
|
||
async function main() { | ||
try { | ||
// Passed to `--extensionDevelopmentPath` | ||
const extensionDevelopmentPath = path.resolve(__dirname, "../../"); | ||
|
||
// Passed to `--extensionTestsPath` | ||
const extensionTestsPath = path.resolve(__dirname, "./e2e/index"); | ||
|
||
await runTests({ extensionDevelopmentPath, extensionTestsPath }); | ||
} catch (err) { | ||
console.error("Failed to run tests", err); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
main(); |
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