mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
🔥 Added support for Node 14
This commit is contained in:
parent
a4f6d1f01e
commit
c262a6a341
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
||||
strategy:
|
||||
matrix:
|
||||
node: [ '10.13.0', '12.10.0' ]
|
||||
node: [ '10.13.0', '12.10.0', '14.14.0' ]
|
||||
env:
|
||||
- DB: sqlite3
|
||||
NODE_ENV: testing
|
||||
|
@ -36,7 +36,7 @@
|
||||
"fixmodulenotdefined": "yarn cache clean && cd core/client && rm -rf node_modules tmp dist && yarn && cd ../../"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10.13.0 || ^12.10.0",
|
||||
"node": "^10.13.0 || ^12.10.0 || ^14.14.0",
|
||||
"cli": "^1.12.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -11,13 +11,13 @@ describe('lib/fs/package-json: read', function () {
|
||||
|
||||
// create example theme
|
||||
fs.mkdirSync(join(packagePath.name, 'casper'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'index.hbs'), '');
|
||||
|
||||
// create some trash
|
||||
fs.mkdirSync(join(packagePath.name, 'node_modules'));
|
||||
fs.mkdirSync(join(packagePath.name, 'bower_components'));
|
||||
fs.mkdirSync(join(packagePath.name, '.git'));
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'), '');
|
||||
|
||||
packageJSON.read.all(packagePath.name)
|
||||
.then(function (pkgs) {
|
||||
@ -48,7 +48,7 @@ describe('lib/fs/package-json: read', function () {
|
||||
// create example theme
|
||||
fs.mkdirSync(join(packagePath.name, 'testtheme'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'package.json'), pkgJson);
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'), '');
|
||||
|
||||
packageJSON.read.all(packagePath.name)
|
||||
.then(function (pkgs) {
|
||||
@ -81,7 +81,7 @@ describe('lib/fs/package-json: read', function () {
|
||||
// create example theme
|
||||
fs.mkdirSync(join(packagePath.name, 'testtheme'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'package.json'), pkgJson);
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'), '');
|
||||
|
||||
packageJSON.read.all(packagePath.name)
|
||||
.then(function (pkgs) {
|
||||
@ -106,13 +106,13 @@ describe('lib/fs/package-json: read', function () {
|
||||
|
||||
// create example theme
|
||||
fs.mkdirSync(join(packagePath.name, 'casper'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'index.hbs'), '');
|
||||
|
||||
// create some trash
|
||||
fs.mkdirSync(join(packagePath.name, 'node_modules'));
|
||||
fs.mkdirSync(join(packagePath.name, 'bower_components'));
|
||||
fs.mkdirSync(join(packagePath.name, '.git'));
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'), '');
|
||||
|
||||
packageJSON.read.one(packagePath.name, 'casper')
|
||||
.then(function (pkgs) {
|
||||
@ -143,7 +143,7 @@ describe('lib/fs/package-json: read', function () {
|
||||
// create example theme
|
||||
fs.mkdirSync(join(packagePath.name, 'testtheme'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'package.json'), pkgJson);
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'), '');
|
||||
|
||||
packageJSON.read.one(packagePath.name, 'testtheme')
|
||||
.then(function (pkgs) {
|
||||
@ -176,7 +176,7 @@ describe('lib/fs/package-json: read', function () {
|
||||
// create example theme
|
||||
fs.mkdirSync(join(packagePath.name, 'testtheme'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'package.json'), pkgJson);
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'testtheme', 'index.hbs'), '');
|
||||
|
||||
packageJSON.read.one(packagePath.name, 'testtheme')
|
||||
.then(function (pkgs) {
|
||||
@ -198,16 +198,16 @@ describe('lib/fs/package-json: read', function () {
|
||||
const packagePath = tmp.dirSync({unsafeCleanup: true});
|
||||
|
||||
// create trash
|
||||
fs.writeFileSync(join(packagePath.name, 'casper.zip'));
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper.zip'), '');
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'), '');
|
||||
|
||||
// create actual theme
|
||||
fs.mkdirSync(join(packagePath.name, 'casper'));
|
||||
fs.mkdirSync(join(packagePath.name, 'casper', 'partials'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'partials', 'navigation.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'index.hbs'), '');
|
||||
fs.writeFileSync(join(packagePath.name, 'casper', 'partials', 'navigation.hbs'), '');
|
||||
fs.mkdirSync(join(packagePath.name, 'not-casper'));
|
||||
fs.writeFileSync(join(packagePath.name, 'not-casper', 'index.hbs'));
|
||||
fs.writeFileSync(join(packagePath.name, 'not-casper', 'index.hbs'), '');
|
||||
|
||||
packageJSON.read.one(packagePath.name, 'casper')
|
||||
.then(function (pkgs) {
|
||||
@ -229,8 +229,8 @@ describe('lib/fs/package-json: read', function () {
|
||||
const packagePath = tmp.dirSync({unsafeCleanup: true});
|
||||
|
||||
// create trash
|
||||
fs.writeFileSync(join(packagePath.name, 'casper.zip'));
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper.zip'), '');
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'), '');
|
||||
|
||||
packageJSON.read.one(packagePath.name, 'casper')
|
||||
.then(function () {
|
||||
@ -247,8 +247,8 @@ describe('lib/fs/package-json: read', function () {
|
||||
const packagePath = tmp.dirSync({unsafeCleanup: true});
|
||||
|
||||
// create trash
|
||||
fs.writeFileSync(join(packagePath.name, 'casper.zip'));
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(packagePath.name, 'casper.zip'), '');
|
||||
fs.writeFileSync(join(packagePath.name, '.DS_Store'), '');
|
||||
|
||||
packageJSON.read.one(packagePath.name, 'casper.zip')
|
||||
.then(function (pkg) {
|
||||
|
@ -27,14 +27,14 @@ describe('Themes', function () {
|
||||
describe('Load All', function () {
|
||||
it('should load directory and include only folders', function (done) {
|
||||
// create trash
|
||||
fs.writeFileSync(join(themePath.name, 'casper.zip'));
|
||||
fs.writeFileSync(join(themePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper.zip'), '');
|
||||
fs.writeFileSync(join(themePath.name, '.DS_Store'), '');
|
||||
|
||||
// create actual theme
|
||||
fs.mkdirSync(join(themePath.name, 'casper'));
|
||||
fs.mkdirSync(join(themePath.name, 'casper', 'partials'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper', 'index.hbs'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper', 'partials', 'navigation.hbs'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper', 'index.hbs'), '');
|
||||
fs.writeFileSync(join(themePath.name, 'casper', 'partials', 'navigation.hbs'), '');
|
||||
|
||||
loader.loadAllThemes()
|
||||
.then(function (result) {
|
||||
@ -58,8 +58,8 @@ describe('Themes', function () {
|
||||
|
||||
it('should read directory and read package.json if present', function (done) {
|
||||
// create trash
|
||||
fs.writeFileSync(join(themePath.name, 'README.md'));
|
||||
fs.writeFileSync(join(themePath.name, 'Thumbs.db'));
|
||||
fs.writeFileSync(join(themePath.name, 'README.md'), '');
|
||||
fs.writeFileSync(join(themePath.name, 'Thumbs.db'), '');
|
||||
|
||||
// create actual theme
|
||||
fs.mkdirSync(join(themePath.name, 'casper'));
|
||||
@ -98,18 +98,18 @@ describe('Themes', function () {
|
||||
describe('Load One', function () {
|
||||
it('should read directory and include only single requested theme', function (done) {
|
||||
// create trash
|
||||
fs.writeFileSync(join(themePath.name, 'casper.zip'));
|
||||
fs.writeFileSync(join(themePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper.zip'), '');
|
||||
fs.writeFileSync(join(themePath.name, '.DS_Store'), '');
|
||||
|
||||
// create actual theme
|
||||
fs.mkdirSync(join(themePath.name, 'casper'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper', 'index.hbs'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper', 'index.hbs'), '');
|
||||
fs.writeFileSync(
|
||||
join(themePath.name, 'casper', 'package.json'),
|
||||
JSON.stringify({name: 'casper', version: '0.1.2'})
|
||||
);
|
||||
fs.mkdirSync(join(themePath.name, 'not-casper'));
|
||||
fs.writeFileSync(join(themePath.name, 'not-casper', 'index.hbs'));
|
||||
fs.writeFileSync(join(themePath.name, 'not-casper', 'index.hbs'), '');
|
||||
|
||||
loader.loadOneTheme('casper')
|
||||
.then(function (themeResult) {
|
||||
@ -126,8 +126,8 @@ describe('Themes', function () {
|
||||
|
||||
it('should throw an error if theme cannot be found', function (done) {
|
||||
// create trash
|
||||
fs.writeFileSync(join(themePath.name, 'casper.zip'));
|
||||
fs.writeFileSync(join(themePath.name, '.DS_Store'));
|
||||
fs.writeFileSync(join(themePath.name, 'casper.zip'), '');
|
||||
fs.writeFileSync(join(themePath.name, '.DS_Store'), '');
|
||||
|
||||
loader.loadOneTheme('casper')
|
||||
.then(function () {
|
||||
|
@ -28,7 +28,8 @@ module.exports = {
|
||||
destroyed: false,
|
||||
cork: function () {},
|
||||
uncork: function () {},
|
||||
write: function () {}
|
||||
write: function () {},
|
||||
on: function () {}
|
||||
};
|
||||
|
||||
return new Promise(function (resolve) {
|
||||
|
Loading…
Reference in New Issue
Block a user