Skip to content

Commit

Permalink
chore: ci workaround mocha issue
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswuerbach committed Jun 20, 2024
1 parent a1813fc commit 9835310
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
import * as path from 'path';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'node:path';
import * as fs from 'node:fs';
import * as os from 'node:os';
import { platform } from 'node:process';
import { defineConfig } from '@vscode/test-cli';
import { globSync } from 'glob';

// Workaround https://github.com/microsoft/vscode/issues/86382, but creating a tmp user data dir
const userDir = fs.mkdtempSync(path.join(os.tmpdir(), 'vscode-humanitec-'));

let files = 'out/test/**/*.test.js';

if (platform === 'win32') {
// Workaround https://github.com/mochajs/mocha/issues/4851
files = globSync('out/test/**/*.test.js', { absolute: true }).map(f =>
f.toLowerCase()
);
}

// eslint-disable-next-line no-undef
console.log(files);

export default defineConfig([
{
label: 'unitTests',
files: 'out/test/**/*.test.js',
files,
workspaceFolder: './src/test/test-fixtures/workspace',
mocha: {
ui: 'tdd',
timeout: 20000,
asyncOnly: true,
failZero: true,
},
launchArgs: [`--user-data-dir=${userDir}`, '--disable-extensions'],
},
Expand Down

0 comments on commit 9835310

Please sign in to comment.