dsi-icl/optimise

View on GitHub
packages/optimise-core/src/db/index.js

Summary

Maintainability
A
0 mins
Test Coverage
// We need to mock require.context() for Jest environment
if (process.env.NODE_ENV === 'test')
    require('babel-plugin-require-context-hook/register')();

const schemasContext = require.context('.', false, /\.table\.js$/);
const schemas = schemasContext.keys().map(file => schemasContext(file)).sort((a, b) => a.PRIORITY - b.PRIORITY).map(descriptor => descriptor.default);

export default schemas;