.ts, .tsx - Format according to prettier

This commit is contained in:
2019-12-15 16:38:38 +05:30
parent 1019de3d9f
commit 509775028c
3 changed files with 28 additions and 28 deletions
+13 -13
View File
@@ -1,23 +1,23 @@
import * as React from "react";
import { render } from "../src/renderer";
import * as React from 'react';
import { render } from '../src/renderer';
test("should render plain text", () => {
expect((render("abcd") as string).trim()).toBe("abcd");
test('should render plain text', () => {
expect((render('abcd') as string).trim()).toBe('abcd');
});
test("should render numbers as text", () => {
expect((render(123) as string).trim()).toBe("123");
test('should render numbers as text', () => {
expect((render(123) as string).trim()).toBe('123');
});
test("should render null and not fail for empty values", () => {
test('should render null and not fail for empty values', () => {
expect(render(null)).toBe(null);
expect(render(undefined)).toBe(null);
expect(render([])).toBe(null);
});
test("should render plain text with simple Function Component", () => {
test('should render plain text with simple Function Component', () => {
function TestComponent() {
return "abcd";
return 'abcd';
}
// Note: Rendering string from JSX shows TS error (https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20544). This is a workaround.
@@ -25,15 +25,15 @@ test("should render plain text with simple Function Component", () => {
(render(
React.createElement((TestComponent as unknown) as React.FunctionComponent)
) as string).trim()
).toBe("abcd");
).toBe('abcd');
});
test("should render plain text with simple Class Component", () => {
test('should render plain text with simple Class Component', () => {
class TestComponent extends React.Component {
render() {
return "abcd";
return 'abcd';
}
}
expect((render(<TestComponent />) as string).trim()).toBe("abcd");
expect((render(<TestComponent />) as string).trim()).toBe('abcd');
});