mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
refactor: move core to mono repo
This commit is contained in:
29
core/test/schema.spec.ts
Normal file
29
core/test/schema.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import {validateFiles, writeReport} from '@openstapps/core-tools/lib/validate';
|
||||
import {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {expect} from 'chai';
|
||||
import {mkdirSync} from 'fs';
|
||||
import {join, resolve} from 'path';
|
||||
|
||||
@suite(timeout(15000), slow(10000))
|
||||
export class SchemaSpec {
|
||||
@test
|
||||
async 'validate against test files'() {
|
||||
const errorsPerFile = {
|
||||
...await validateFiles(resolve('lib', 'schema'), resolve('test', 'resources')),
|
||||
...await validateFiles(resolve('lib', 'schema'), resolve('test', 'resources', 'indexable')),
|
||||
};
|
||||
|
||||
let unexpected = false;
|
||||
Object.keys(errorsPerFile).forEach((file) => {
|
||||
unexpected = unexpected || errorsPerFile[file].some((error) => !error.expected);
|
||||
});
|
||||
|
||||
mkdirSync('report', {
|
||||
recursive: true,
|
||||
});
|
||||
|
||||
await writeReport(join('report', 'index.html'), errorsPerFile);
|
||||
|
||||
expect(unexpected).to.be.equal(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user