prettier-eslint-cli
Version:
CLI for prettier-eslint
64 lines (62 loc) • 2.19 kB
JavaScript
;
var messages = _interopRequireWildcard(require("./messages"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
/*eslint import/namespace: [2, { allowComputed: true }]*/
const tests = {
success: [{
input: {
success: 'success',
count: 1,
countString: '1String'
},
output: 'success formatting 1String file with prettier-eslint'
}, {
input: {
success: 'success',
count: 3,
countString: '3String'
},
output: 'success formatting 3String files with prettier-eslint'
}],
failure: [{
input: {
failure: 'failure',
count: 1,
countString: '1String'
},
output: 'failure formatting 1String file with prettier-eslint'
}, {
input: {
failure: 'failure',
count: 3,
countString: '3String'
},
output: 'failure formatting 3String files with prettier-eslint'
}],
unchanged: [{
input: {
unchanged: 'unchanged',
count: 1,
countString: '1String'
},
output: '1String file was unchanged'
}, {
input: {
unchanged: 'unchanged',
count: 3,
countString: '3String'
},
output: '3String files were unchanged'
}]
};
Object.keys(tests).forEach(messageKey => {
tests[messageKey].forEach(({
input,
output
}) => {
test(`${messageKey} ${JSON.stringify(input)}`, () => {
expect(messages[messageKey](input)).toEqual(output);
});
});
});