Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions test/test-integration.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*--------------------------------------------------------*/

import * as path from 'path';
import * as os from 'os';
import { createHelpers } from 'yeoman-test';
import * as cp from 'child_process';
import { describe, it, before } from 'node:test';
Expand All @@ -17,17 +18,16 @@ describe('integration tests', { timeout: 7 * 60 * 1000 }, () => {
const appLocation = path.join(fileURLToPath(import.meta.url), '../../generators/app');

const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
let helpers;

before(async function () {
helpers = createHelpers({});
});

// Use a short temp dir to avoid exceeding the 103-char Unix socket path limit.
// macOS TMPDIR resolves to a deep /private/var/folders/... path which, combined
// with the .vscode-test/user-data/*.sock suffix, exceeds the limit.
function makeTmpDir() {
return mkdtempSync('/tmp/vsc-');
if (process.platform === 'darwin') {
return mkdtempSync('/tmp/foo-');
}
return mkdtempSync(path.join(os.tmpdir(), 'foo-'));
}

async function checkAudit(cwd) {
Expand All @@ -43,7 +43,7 @@ describe('integration tests', { timeout: 7 * 60 * 1000 }, () => {
}

it('command-ts integration test (install, compile and run extension tests)', async () => {

const helpers = createHelpers({});
const runResult = await helpers.run(appLocation).inDir(makeTmpDir()).withAnswers({
type: 'ext-command-ts',
name: 'testCom',
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('integration tests', { timeout: 7 * 60 * 1000 }, () => {
});

it('command-ts-webpack integration test (install, pack and run extension tests)', async () => {

const helpers = createHelpers({});
const runResult = await helpers.run(appLocation).inDir(makeTmpDir()).withAnswers({
type: 'ext-command-ts',
name: 'testCom',
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('integration tests', { timeout: 7 * 60 * 1000 }, () => {
});

it('command-ts-esbuild integration test (install, pack and run extension tests)', async () => {

const helpers = createHelpers({});
const runResult = await helpers.run(appLocation).inDir(makeTmpDir()).withAnswers({
type: 'ext-command-ts',
name: 'testCom',
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('integration tests', { timeout: 7 * 60 * 1000 }, () => {
});

it('command-ts-web-webpack integration test (install, pack and run extension tests)', async () => {

const helpers = createHelpers({});
const runResult = await helpers.run(appLocation).inDir(makeTmpDir()).withAnswers({
type: 'ext-command-web',
name: 'testCom',
Expand Down Expand Up @@ -164,7 +164,7 @@ describe('integration tests', { timeout: 7 * 60 * 1000 }, () => {
});

it('command-ts-web-esbuild integration test (install, pack and run extension tests)', async () => {

const helpers = createHelpers({});
const runResult = await helpers.run(appLocation).inDir(makeTmpDir()).withAnswers({
type: 'ext-command-web',
name: 'testCom',
Expand Down
Loading