Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertOstermann committed Jul 15, 2023
1 parent 0cc1a3b commit 05c3db7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/features/helper/osmosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class Osmosis {
},
};

const abortController = new AbortController();
const abortController: any = new AbortController();
const timeoutHandler = setTimeout(() => {
abortController.abort();
}, timeout);
Expand Down Expand Up @@ -103,4 +103,3 @@ export class Osmosis {
return await response.json() as T;
}
}

29 changes: 15 additions & 14 deletions test/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,34 @@ export const run = (): Promise<void> => {
// Create the mocha test
const mocha = new Mocha({
ui: "tdd",
color: true
color: true,
});

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

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

return new Promise((resolve, reject) => {
try {
const testFiles = glob.globSync("**/**.test.js", { cwd: testsRoot });
// Add files to the test suite
files.forEach(f => { return mocha.addFile(path.resolve(testsRoot, f)); });
testFiles.forEach(file => {
return mocha.addFile(path.resolve(testsRoot, file));
});

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

0 comments on commit 05c3db7

Please sign in to comment.