-
Notifications
You must be signed in to change notification settings - Fork 29
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
Showing
8 changed files
with
901 additions
and
804 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
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
import path from 'path'; | ||
import assert from 'assert'; | ||
import { runTests } from '@vscode/test-electron'; | ||
import findUp from 'find-up'; | ||
|
||
async function run(): Promise<void> { | ||
const pkgPath = await findUp('package.json', { | ||
cwd: __dirname | ||
}); | ||
assert.ok(pkgPath); | ||
const extensionDevelopmentPath = path.dirname(pkgPath); | ||
const extensionTestsPath = path.join(__dirname, 'suite'); | ||
const testWorkspace = path.join(extensionDevelopmentPath, 'testProject'); | ||
|
||
await runTests({ | ||
extensionDevelopmentPath, | ||
extensionTestsPath, | ||
launchArgs: [testWorkspace] | ||
.concat(['--skip-welcome']) | ||
.concat(['--disable-extensions']) | ||
.concat(['--skip-release-notes']) | ||
.concat(['--enable-proposed-api']) | ||
}); | ||
} | ||
|
||
void run(); |
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,29 @@ | ||
/* eslint-disable n/no-sync */ | ||
import * as path from 'path'; | ||
import Mocha from 'mocha'; | ||
import { sync as globSync } from 'fast-glob'; | ||
|
||
export function run( | ||
testsRoot: string, | ||
cb: (error: any, failures?: number) => void | ||
): void { | ||
// Create the mocha test | ||
const mocha = new Mocha({ | ||
ui: 'tdd' | ||
}); | ||
|
||
const files = globSync('**/**.test.js', { cwd: testsRoot }); | ||
|
||
// Add files to the test suite | ||
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); | ||
|
||
try { | ||
// Run the mocha test | ||
mocha.run(failures => { | ||
cb(null, failures); | ||
}); | ||
} catch (err) { | ||
console.error(err); | ||
cb(err); | ||
} | ||
} |
Oops, something went wrong.