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:
parent
255b55cab5
commit
e19cd6a919
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue