mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 23:27:20 +03:00
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import * as path from 'path'
|
|
import * as process from 'process'
|
|
import * as glob from 'glob'
|
|
import * as tmpFile from 'tmp'
|
|
import { runTests } from 'vscode-test'
|
|
|
|
async function main() {
|
|
try {
|
|
const extensionDevelopmentPath = path.resolve(__dirname, '../../')
|
|
const extensionTestsPath = path.resolve(__dirname, './index')
|
|
const tmpdir = tmpFile.dirSync({ unsafeCleanup: true })
|
|
|
|
const testBuildWorkspaces = glob.sync('test/fixtures/build/*', { cwd: extensionDevelopmentPath })
|
|
for (const testWorkspace of testBuildWorkspaces) {
|
|
await runTests({
|
|
extensionDevelopmentPath,
|
|
extensionTestsPath,
|
|
launchArgs: [
|
|
testWorkspace,
|
|
'--user-data-dir=' + tmpdir.name,
|
|
'--disable-extensions',
|
|
'--disable-gpu'
|
|
],
|
|
extensionTestsEnv: { LATEXWORKSHOP_CI_ENABLE_DOCKER: process.argv.includes('--enable-docker') ? '1' : undefined }
|
|
})
|
|
}
|
|
|
|
} catch (err) {
|
|
console.error('Failed to run tests')
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
main()
|