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