2021-12-29 21:56:49 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const util = require('util');
|
|
|
|
const exec = util.promisify(require('child_process').exec);
|
|
|
|
|
2021-12-29 22:02:34 +01:00
|
|
|
jest.setTimeout(20000);
|
2021-12-29 21:56:49 +01:00
|
|
|
|
|
|
|
describe('Test the config-sync CLI', () => {
|
|
|
|
test('Export', async () => {
|
|
|
|
const { stdout } = await exec('yarn cs export -y');
|
|
|
|
expect(stdout).toContain('Finished export');
|
|
|
|
});
|
|
|
|
test('Import', async () => {
|
|
|
|
await exec('rm -rf config/sync/admin-role.strapi-editor.json');
|
|
|
|
const { stdout } = await exec('yarn cs import -y');
|
|
|
|
expect(stdout).toContain('Finished import');
|
|
|
|
});
|
|
|
|
test('Diff', async () => {
|
|
|
|
const { stdout } = await exec('yarn cs diff');
|
|
|
|
expect(stdout).toContain('No differences between DB and sync directory');
|
|
|
|
});
|
|
|
|
});
|