mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
a929b6a0f9
- matches logging in ignition: https://github.com/TryGhost/Ignition/blob/master/lib/logging/PrettyStream.js#L11 - so that it's possible to add log lines to our CLI tools that have a consistent format
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
// Switch these lines once there are useful utils
|
|
// const testUtils = require('./utils');
|
|
require('./utils');
|
|
|
|
const prettyCLI = require('../lib/pretty-cli');
|
|
|
|
// Check the API is as we depend on in other modules;
|
|
describe('API', function () {
|
|
it('Exposes styled-sywac, styles & the sywac API', function () {
|
|
// Detect a basic prestyled sywac instance
|
|
prettyCLI.should.be.an.Object().with.property('types');
|
|
prettyCLI.parseAndExit.should.be.a.Function();
|
|
|
|
// Detect the basic sywac Api
|
|
prettyCLI.Api.should.be.a.Function();
|
|
prettyCLI.Api.get.should.be.a.Function();
|
|
|
|
// Detect style rules
|
|
prettyCLI.styles.should.be.an.Object();
|
|
prettyCLI.styles.should.have.properties([
|
|
'usagePrefix',
|
|
'group',
|
|
'flags',
|
|
'hints',
|
|
'groupError',
|
|
'flagsError',
|
|
'descError',
|
|
'hintsError',
|
|
'messages'
|
|
]);
|
|
|
|
prettyCLI.ui.should.be.an.Object();
|
|
prettyCLI.ui.log.should.be.a.Function();
|
|
prettyCLI.ui.log.should.have.properties([
|
|
'ok',
|
|
'trace',
|
|
'debug',
|
|
'info',
|
|
'warn',
|
|
'error',
|
|
'fatal'
|
|
]);
|
|
});
|
|
});
|