mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -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', () => {
|
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/'))
|
return request.put(localUtils.API.getApiQuery('settings/'))
|
||||||
.set('Origin', config.get('url'))
|
.set('Origin', config.get('url'))
|
||||||
.send({
|
.send({
|
||||||
|
@ -91,8 +94,6 @@ describe('DB API', () => {
|
||||||
const jsonResponse = res.body;
|
const jsonResponse = res.body;
|
||||||
should.exist(jsonResponse.db);
|
should.exist(jsonResponse.db);
|
||||||
|
|
||||||
const exportFolder = path.join(os.tmpdir(), uuid.v1());
|
|
||||||
const exportPath = path.join(exportFolder, 'export.json');
|
|
||||||
fs.ensureDirSync(exportFolder);
|
fs.ensureDirSync(exportFolder);
|
||||||
fs.writeJSONSync(exportPath, jsonResponse);
|
fs.writeJSONSync(exportPath, jsonResponse);
|
||||||
|
|
||||||
|
@ -105,6 +106,7 @@ describe('DB API', () => {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
res.body.problems.length.should.eql(3);
|
res.body.problems.length.should.eql(3);
|
||||||
|
fs.removeSync(exportFolder);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue