feat: tests

This commit is contained in:
2023-04-21 12:08:35 +02:00
parent 8cb9285462
commit d8c79256c9
140 changed files with 2100 additions and 2693 deletions

View File

@@ -15,9 +15,9 @@
*/
import {Logger} from '@openstapps/logger';
import {expect} from 'chai';
import {slow, suite, test, timeout} from '@testdeck/mocha';
import {cwd} from 'process';
import {getTsconfigPath} from '../src/common.js';
import path from 'path';
import {fileURLToPath} from 'url';
process.on('unhandledRejection', (reason: unknown): void => {
if (reason instanceof Error) {
@@ -26,10 +26,10 @@ process.on('unhandledRejection', (reason: unknown): void => {
process.exit(1);
});
@suite(timeout(20_000), slow(10_000))
export class CommonSpec {
@test
async getTsconfigPath() {
expect(getTsconfigPath(__dirname)).to.be.equal(cwd());
}
}
describe('common', function () {
describe('getTsconfigPath', function () {
it('should get tsconfig path', function () {
expect(getTsconfigPath(path.dirname(fileURLToPath(import.meta.url)))).to.be.equal(process.cwd());
});
});
});