Skip to content

Commit

Permalink
fix: correct import of glob
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlday committed Mar 4, 2024
1 parent 1727443 commit 0e55e21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/ConfigurationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import execa from "execa";
import * as glob from "glob";
import { glob } from "glob";
import * as path from "path";
import * as portfinder from "portfinder";
import { URL } from "url";
Expand Down Expand Up @@ -400,7 +400,7 @@ export class ConfigurationManager implements Disposable {
if (username && apiKey) {
parameters.set("username", username);
parameters.set("apiKey", apiKey);
}
}
}
// Make sure disabled rules and disabled categories do not contain spaces
const CONFIG_DISABLED_RULES = "languageTool.disabledRules";
Expand Down
36 changes: 16 additions & 20 deletions test/suite/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import glob from "glob";
import { glob } from "glob";
import Mocha from "mocha";
import * as path from "path";

Expand All @@ -12,26 +12,22 @@ export function run(): Promise<void> {
const testsRoot = path.resolve(__dirname, "..");

return new Promise((c, e) => {
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
const files = glob.sync("**/**.test.js", { cwd: testsRoot });

// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));

try {
// Run the mocha test
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
e(err);
}
});
try {
// Run the mocha test
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
e(err);
}
});
}

0 comments on commit 0e55e21

Please sign in to comment.