Skip to content

Commit

Permalink
Fixed glob?
Browse files Browse the repository at this point in the history
  • Loading branch information
rayman2000 committed Aug 28, 2024
1 parent 11b554c commit 0562d69
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 98 deletions.
244 changes: 164 additions & 80 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@typescript-eslint/parser": "^8.3.0",
"@viperproject/locate-java-home": "^1.1.15",
"@vscode/test-electron": "^2.4.1",
"@vscode/vsce": "^2.26.0",
"@vscode/vsce": "^3.0.0",
"eslint": "^9.8.0",
"eslint-webpack-plugin": "^4.2.0",
"glob-to-regexp": "^0.4.1",
Expand Down
28 changes: 11 additions & 17 deletions client/src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import glob from 'glob';
import {glob} from 'glob';
import Mocha from 'mocha';
import * as path from 'path';

Expand All @@ -30,12 +30,12 @@ const TESTS_ROOT = __dirname;
*/
export async function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd',
// Installing and starting Viper might take some minutes
const mocha = new Mocha({
ui: 'tdd',
// Installing and starting Viper might take some minutes
timeout: 300_000, // ms
color: true,
});
});

const filenames = await getTestSuiteFilenames();
filenames.forEach(filename => mocha.addFile(path.resolve(TESTS_ROOT, filename)));
Expand All @@ -50,16 +50,10 @@ export async function run(): Promise<void> {
}

async function getTestSuiteFilenames(): Promise<string[]> {
return new Promise((resolve, reject) =>
glob(
"**/*.test.js",
{
cwd: TESTS_ROOT,
},
(err, result) => {
if (err) reject(err)
else resolve(result)
}
)
);
return glob(
"**/*.test.js",
{
cwd: TESTS_ROOT,
}
)
}

0 comments on commit 0562d69

Please sign in to comment.