mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2026-09-03 20:25:32 -04:00
Clean up tests
This commit is contained in:
+8
-5
@@ -2,8 +2,11 @@
|
|||||||
|
|
||||||
const bin = require('.');
|
const bin = require('.');
|
||||||
|
|
||||||
bin.run(['version']).then(() => {
|
(async () => {
|
||||||
console.log('✔ Hugo installed successfully!');
|
try {
|
||||||
}).catch(error => {
|
await bin.run(['version']);
|
||||||
console.error('✖ ERROR: Hugo installation failed. :(\n', error);
|
console.log('✔ Hugo installed successfully!');
|
||||||
});
|
} catch (error) {
|
||||||
|
console.error('✖ ERROR: Hugo installation failed. :(\n', error);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|||||||
+2
-7
@@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "node lib/install.js",
|
"postinstall": "node lib/install.js",
|
||||||
"test": "xo && mocha"
|
"test": "xo && mocha && node cli.js env"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
@@ -49,14 +49,9 @@
|
|||||||
"hugo": "cli.js"
|
"hugo": "cli.js"
|
||||||
},
|
},
|
||||||
"xo": {
|
"xo": {
|
||||||
"envs": [
|
|
||||||
"es6",
|
|
||||||
"node"
|
|
||||||
],
|
|
||||||
"space": true,
|
"space": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"object-curly-spacing": "off",
|
"object-curly-spacing": "off"
|
||||||
"promise/prefer-await-to-then": "warn"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-16
@@ -5,21 +5,7 @@
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const binCheck = require('bin-check');
|
const binCheck = require('bin-check');
|
||||||
const hugoBin = require('..');
|
const hugoBin = require('..');
|
||||||
const { execFile } = require('child_process');
|
|
||||||
|
|
||||||
it('Hugo exists and runs?', () => {
|
it('Hugo exists and runs?', async () => {
|
||||||
return binCheck(hugoBin, ['version']).then(works => {
|
assert(await binCheck(hugoBin, ['version']));
|
||||||
assert(works);
|
|
||||||
|
|
||||||
// Print additional build environment variables if check successful
|
|
||||||
if (works) {
|
|
||||||
execFile(hugoBin, ['env'], (error, stdout) => {
|
|
||||||
if (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(stdout);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user