Skip to content

Commit

Permalink
fix test file indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fauna-chase committed Jul 26, 2023
1 parent 2110ec3 commit b98a8ce
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions src/test/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@ export async function run(): Promise<void> {

const testsRoot = path.resolve(__dirname, "..");

return new Promise((resolve, reject) => {
let filesP = glob("**/**.test.js", { cwd: testsRoot });
filesP.then(files => {
console.error(files);
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
return new Promise((resolve, reject) => {
let filesP = glob("**/**.test.js", { cwd: testsRoot });
filesP.then(files => {
console.error(files);
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));

try {
mocha.run((failures) => {
process.exitCode = failures ? 1 : 0;
if (failures > 0) {
reject(new Error(`${failures} tests failed`));
} else {
resolve();
}
});
} catch (err) {
console.error(err);
process.exitCode = 1;
}
}).catch(error => {
console.error("failed to run tests");
console.error(error);
});
});
try {
mocha.run((failures) => {
process.exitCode = failures ? 1 : 0;
if (failures > 0) {
reject(new Error(`${failures} tests failed`));
} else {
resolve();
}
});
} catch (err) {
console.error(err);
process.exitCode = 1;
}
}).catch(error => {
console.error(`failed to run tests ${error}`);
});
});
}

0 comments on commit b98a8ce

Please sign in to comment.