graphql-engine/cli-ext/tests/actions-codegen/test.js
Aravind Shankar bb63d7e60e
cli: allow managing actions (#3859)
Co-authored-by: Rishichandra Wawhal <rishichandra.wawhal@gmail.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Aravind <aravindkp@outlook.in>
Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
Co-authored-by: Shahidh K Muhammed <muhammedshahid.k@gmail.com>
2020-02-24 21:44:46 +05:30

24 lines
599 B
JavaScript

const { getActionsCodegen } = require('../../build/services/actions-codegen/codegen');
const { samplePayload } = require('./payload');
const test = async () => {
try {
const codegenFiles = await getActionsCodegen(samplePayload);
if (codegenFiles) {
console.log('✓ Actions codegen test passed');
} else {
console.log('✘ Actions codegen test failed');
console.log('Received empty codegen');
process.exit(1);
}
} catch (e) {
console.log('✘ Actions codegen test failed');
console.error(e);
process.exit(1);
}
};
module.exports = test;