Files
test-repo/tests_integration/__tests__/deprecated-parser.js
T
Lucas Azzola b0cb63a7bb Use destructuring for imports (#4554)
* Use destructuring for imports

* Clean up integration tests

* Use moduleNameMapper for require_prettier
2018-05-27 21:36:12 +10:00

27 lines
501 B
JavaScript

"use strict";
const prettier = require("prettier/local");
let warnings = "";
beforeAll(() => {
jest
.spyOn(console, "warn")
.mockImplementation(text => (warnings += text + "\n"));
});
beforeEach(() => {
warnings = "";
});
afterAll(() => {
jest.restoreAllMocks();
});
test("API format with deprecated parser should work", () => {
expect(() =>
prettier.format("body { color: #131313; }", { parser: "postcss" })
).not.toThrowError();
expect(warnings).toMatchSnapshot();
});