Skip to content

Commit

Permalink
Tests: Use arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Feb 10, 2019
1 parent 16d34d0 commit f15a512
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions test/lazy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ describe('nested lazy components', () => {
`));
});

describe('rejects when promise marked no SSR', function() {
describe('rejects when promise marked no SSR', () => {
itRenders('when nested 1 deep', async ({render}) => {
const LazyInner = lazy(() => <div>Lazy inner</div>, {noSsr: true});
const Lazy = lazy(() => <div>Before Lazy Layer 1<LazyInner/>After Lazy Layer 1</div>);
Expand Down Expand Up @@ -675,7 +675,7 @@ describe('nested lazy components', () => {
});
});

describe('renders fallback when promise marked no SSR', function() {
describe('renders fallback when promise marked no SSR', () => {
itRenders('when nested 1 deep', async ({render, openTag}) => {
const LazyInner = lazy(() => <div>Lazy inner</div>, {noSsr: true});
const Lazy = lazy(() => <div>Before Lazy Layer 1<LazyInner/>After Lazy Layer 1</div>);
Expand Down
8 changes: 4 additions & 4 deletions test/lazySpacing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('lazy-loaded components space correctly', () => {
});
});

describe('and div(s)', function() {
describe('and div(s)', () => {
itRendersWithSyncCompare('before', async ({render, lazy, openTag}) => {
const Lazy = lazy(() => null);
const e = (
Expand Down Expand Up @@ -206,15 +206,15 @@ describe('lazy-loaded components space correctly', () => {
});
});

describe('with div inside lazy', function() {
describe('with div inside lazy', () => {
itRendersWithSyncCompare('only', async ({render, lazy, openTag}) => {
const Lazy = lazy(() => <div>Inside</div>);
const e = <Lazy/>;
const h = await render(e);
expect(h).toBe(`<div${openTag}>Inside</div>`);
});

describe('and string(s)', function() {
describe('and string(s)', () => {
itRendersWithSyncCompare('before', async ({render, lazy, openTag}) => {
const Lazy = lazy(() => <div>Inside</div>);
const e = (
Expand Down Expand Up @@ -253,7 +253,7 @@ describe('lazy-loaded components space correctly', () => {
});
});

describe('and div(s)', function() {
describe('and div(s)', () => {
itRendersWithSyncCompare('before', async ({render, lazy, openTag}) => {
const Lazy = lazy(() => <div>Inside</div>);
const e = (
Expand Down
8 changes: 4 additions & 4 deletions test/noSuspense.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const {itRendersWithSyncCompare} = require('./utils');

// Tests

describe('without Suspense', function() {
describe('plain', function() {
describe('without Suspense', () => {
describe('plain', () => {
itRendersWithSyncCompare('string', async ({render}) => {
const e = 'text';
const h = await render(e);
Expand All @@ -34,7 +34,7 @@ describe('without Suspense', function() {
});
});

describe('in function component', function() {
describe('in function component', () => {
itRendersWithSyncCompare('string', async ({render}) => {
const Comp = () => 'text';
const e = <Comp/>;
Expand All @@ -57,7 +57,7 @@ describe('without Suspense', function() {
});
});

describe('in class component', function() {
describe('in class component', () => {
itRendersWithSyncCompare('string', async ({render}) => {
class Comp extends React.Component {
render() {
Expand Down
8 changes: 4 additions & 4 deletions test/suspenseSpacing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('suspense spaces correctly', () => {
});
});

describe('and div(s)', function() {
describe('and div(s)', () => {
itRendersWithSyncCompare('before', async ({render, Suspense, openTag}) => {
const e = (
<div>
Expand Down Expand Up @@ -192,14 +192,14 @@ describe('suspense spaces correctly', () => {
});
});

describe('with div inside Suspense', function() {
describe('with div inside Suspense', () => {
itRendersWithSyncCompare('only', async ({render, Suspense, openTag}) => {
const e = <Suspense><div>Inside</div></Suspense>;
const h = await render(e);
expect(h).toBe(`<div${openTag}>Inside</div>`);
});

describe('and string(s)', function() {
describe('and string(s)', () => {
itRendersWithSyncCompare('before', async ({render, Suspense, openTag}) => {
const e = (
<div>
Expand Down Expand Up @@ -235,7 +235,7 @@ describe('suspense spaces correctly', () => {
});
});

describe('and div(s)', function() {
describe('and div(s)', () => {
itRendersWithSyncCompare('before', async ({render, Suspense, openTag}) => {
const e = (
<div>
Expand Down

0 comments on commit f15a512

Please sign in to comment.