mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 14:02:48 +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 {Converter} from '../src/schema.js';
|
||||
import path from 'path';
|
||||
import {fileURLToPath} from 'url';
|
||||
|
||||
process.on('unhandledRejection', (error: unknown) => {
|
||||
if (error instanceof Error) {
|
||||
@@ -26,11 +26,14 @@ process.on('unhandledRejection', (error: unknown) => {
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@suite(timeout(40_000), slow(10_000))
|
||||
export class SchemaSpec {
|
||||
@test
|
||||
async getSchema() {
|
||||
const converter = new Converter(path.join(__dirname, '..', 'src', 'resources'));
|
||||
describe('Schema', function () {
|
||||
this.timeout(40_000);
|
||||
this.slow(10_000);
|
||||
|
||||
it('should create schema', function () {
|
||||
const converter = new Converter(
|
||||
path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'src', 'resources'),
|
||||
);
|
||||
|
||||
const schema = converter.getSchema('Foo', '0.0.1');
|
||||
expect(schema).to.be.deep.equal({
|
||||
@@ -77,5 +80,5 @@ export class SchemaSpec {
|
||||
required: ['lorem', 'type'],
|
||||
type: 'object',
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user