mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
feat: tests
This commit is contained in:
@@ -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());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user