@zendesk/zcli-themes
Version:
zcli theme commands live here
40 lines (39 loc) • 1.7 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const test_1 = require("@oclif/test");
const validationErrorsToString_1 = require("./validationErrorsToString");
describe('validationErrorsToString', () => {
it('returns a formatted string containing all validation errors', () => {
const validationErrors = {
'templates/home_page.hbs': [
{
description: 'not possible to access `names` in `help_center.names`',
line: 1,
column: 45,
length: 5
},
{
description: "'articles' does not exist",
line: 21,
column: 16,
length: 11
}
],
'templates/new_request_page.hbs': [
{
description: "'post_form' does not exist",
line: 22,
column: 6,
length: 10
}
]
};
const string = (0, validationErrorsToString_1.default)('theme/path', validationErrors);
(0, test_1.expect)(string).to.contain('theme/path/templates/home_page.hbs:1:45');
(0, test_1.expect)(string).to.contain('not possible to access `names` in `help_center.names`');
(0, test_1.expect)(string).to.contain('theme/path/templates/home_page.hbs:21:16');
(0, test_1.expect)(string).to.contain("'articles' does not exist");
(0, test_1.expect)(string).to.contain('templates/new_request_page.hbs');
(0, test_1.expect)(string).to.contain("'post_form' does not exist");
});
});