UNPKG

@unibeautify/beautifier-sqlformat

Version:
69 lines 2.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const fs = require("fs"); const path = require("path"); const unibeautify_1 = require("unibeautify"); const src_1 = require("../../src"); const utils_1 = require("../utils"); // tslint:disable:mocha-no-side-effect-code test(`should uppercase SQL identifiers`, () => { const text = fs .readFileSync(path.resolve(__dirname, `../fixtures/test2.sql`)) .toString(); const unibeautify = unibeautify_1.newUnibeautify(); unibeautify.loadBeautifier(src_1.default); return unibeautify .beautify({ languageName: "SQL", options: { SQL: { identifier_case: "uppercase", }, }, text, }) .then(results => { expect(utils_1.raw(results)).toMatchSnapshot(); }); }); test(`should capitalize SQL identifiers`, () => { const text = fs .readFileSync(path.resolve(__dirname, `../fixtures/test2.sql`)) .toString(); const unibeautify = unibeautify_1.newUnibeautify(); unibeautify.loadBeautifier(src_1.default); return unibeautify .beautify({ languageName: "SQL", options: { SQL: { identifier_case: "capitalize", }, }, text, }) .then(results => { expect(utils_1.raw(results)).toMatchSnapshot(); }); }); test(`should lowercase SQL identifiers`, () => { const text = fs .readFileSync(path.resolve(__dirname, `../fixtures/test2.sql`)) .toString(); const unibeautify = unibeautify_1.newUnibeautify(); unibeautify.loadBeautifier(src_1.default); return unibeautify .beautify({ languageName: "SQL", options: { SQL: { identifier_case: "lowercase", }, }, text, }) .then(results => { expect(utils_1.raw(results)).toMatchSnapshot(); }); }); //# sourceMappingURL=identifierCase.spec.js.map