0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Modified export/import regression test so it doesn't leave leftover files

This commit is contained in:
Nazar Gargol 2019-03-08 13:54:28 +08:00 committed by Katharina Irrgang
parent 255b55cab5
commit e19cd6a919

View file

@ -68,6 +68,9 @@ describe('DB API', () => {
});
it('can export & import', () => {
const exportFolder = path.join(os.tmpdir(), uuid.v1());
const exportPath = path.join(exportFolder, 'export.json');
return request.put(localUtils.API.getApiQuery('settings/'))
.set('Origin', config.get('url'))
.send({
@ -91,8 +94,6 @@ describe('DB API', () => {
const jsonResponse = res.body;
should.exist(jsonResponse.db);
const exportFolder = path.join(os.tmpdir(), uuid.v1());
const exportPath = path.join(exportFolder, 'export.json');
fs.ensureDirSync(exportFolder);
fs.writeJSONSync(exportPath, jsonResponse);
@ -105,6 +106,7 @@ describe('DB API', () => {
})
.then((res) => {
res.body.problems.length.should.eql(3);
fs.removeSync(exportFolder);
});
});