mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
1af0dbc717
no issue - replace test themes - otherwise they are all invalid with the new GScan version - fix general tests because of Ghost 2.0 logic
50 lines
1.6 KiB
JavaScript
50 lines
1.6 KiB
JavaScript
var should = require('should'),
|
|
path = require('path'),
|
|
fs = require('fs-extra'),
|
|
extract = require('extract-zip'),
|
|
fsLib = require('../../../../server/lib/fs');
|
|
|
|
describe('lib/fs: read csv', function () {
|
|
const symlinkPath = path.join(__dirname, '..', '..', '..', 'utils', 'fixtures', 'themes', 'theme-symlink'),
|
|
folderToSymlink = path.join(__dirname, '..', '..', '..', 'utils', 'fixtures', 'themes', 'casper'),
|
|
zipDestination = path.join(__dirname, '..', '..', '..', 'utils', 'fixtures', 'themes', 'theme-symlink.zip'),
|
|
unzipDestination = path.join(__dirname, '..', '..', '..', 'utils', 'fixtures', 'themes', 'theme-symlink-unzipped');
|
|
|
|
before(function () {
|
|
fs.removeSync(symlinkPath);
|
|
fs.removeSync(zipDestination);
|
|
fs.removeSync(unzipDestination);
|
|
});
|
|
|
|
after(function () {
|
|
fs.removeSync(symlinkPath);
|
|
fs.removeSync(zipDestination);
|
|
fs.removeSync(unzipDestination);
|
|
});
|
|
|
|
it('ensure symlinks work', function (done) {
|
|
fs.symlink(folderToSymlink, symlinkPath);
|
|
|
|
fsLib.zipFolder(symlinkPath, zipDestination, function (err) {
|
|
if (err) {
|
|
return done(err);
|
|
}
|
|
|
|
extract(zipDestination, {dir: unzipDestination}, function (err) {
|
|
if (err) {
|
|
return done(err);
|
|
}
|
|
|
|
fs.readdir(unzipDestination, function (err, files) {
|
|
if (err) {
|
|
return done(err);
|
|
}
|
|
|
|
files.length.should.eql(16);
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|