Skip to content

Commit

Permalink
Clearing useless test code
Browse files Browse the repository at this point in the history
  • Loading branch information
Havunen committed Nov 1, 2023
1 parent a1c6997 commit 9702174
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,24 +510,20 @@ describe('SSR Creation Queue Streams - (non-JSX)', () => {
},
];

testEntries.forEach((test) => {
for (const test of testEntries) {
it(test.description, async (done) => {
const vDom = test.template('foo');
return await streamPromise(vDom).then(function (output) {
if (typeof test.result === 'object') {
expect(output[0]).toEqual(test.result[0]);
expect(output[1]).toBe(test.result[1]);
} else {
const container = document.createElement('div');
document.body.appendChild(container);
container.innerHTML = output;
expect(output[1]).toBe(test.result);
document.body.removeChild(container);
}
done();
});
});
});
}

describe('Component hook', () => {
it('Should allow changing state in CWM', async () => {
Expand Down Expand Up @@ -578,11 +574,7 @@ describe('SSR Creation Queue Streams - (non-JSX)', () => {

const vDom = <Tester />;
await streamPromise(vDom).then(function (output) {
const container = document.createElement('div');
document.body.appendChild(container);
container.innerHTML = output;
expect(output[1]).toBe('<div>bar2<div>bar2</div></div>');
document.body.removeChild(container);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ describe('SSR Root Creation Streams - (non-JSX)', () => {

const vDom = createElement(Tester);
await streamPromise(vDom).then(function (output) {
const container = document.createElement('div');
document.body.appendChild(container);
container.innerHTML = output;
expect(output).toBe('<div>bar2<div>bar2</div></div>');
document.body.removeChild(container);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,7 @@ describe('SSR Creation Streams - (non-JSX)', () => {
const container = document.createElement('div');
const vDom = test.template('foo');
return streamPromise(vDom).then(function (output) {
document.body.appendChild(container);
container.innerHTML = output;
expect(output).toBe(test.result);
document.body.removeChild(container);
});
});
});
Expand Down Expand Up @@ -389,11 +386,7 @@ describe('SSR Creation Streams - (non-JSX)', () => {

const vDom = <Tester />;
return streamPromise(vDom).then(function (output) {
const container = document.createElement('div');
document.body.appendChild(container);
container.innerHTML = output;
expect(output).toBe('<div>bar2<div>bar2</div></div>');
document.body.removeChild(container);
});
});
});
Expand Down
8 changes: 2 additions & 6 deletions packages/inferno-server/__tests__/creation.spec.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,12 @@ describe('SSR Creation (non-JSX)', () => {
},
];

testEntries.forEach((test) => {
for (const test of testEntries) {
it(test.description, () => {
const container = document.createElement('div');
const vDom = test.template('foo');
const output = renderToStaticMarkup(vDom);

document.body.appendChild(container);
container.innerHTML = output;
expect(output).toBe(test.result);
document.body.removeChild(container);
});
});
}
});
8 changes: 0 additions & 8 deletions packages/inferno-server/__tests__/creation.spec.server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,10 @@ describe('SSR Creation (JSX)', () => {

testEntries.forEach((test) => {
it(test.description, () => {
const container = document.createElement('div');
const vDom = test.template('foo');
const output = renderToStaticMarkup(vDom);

document.body.appendChild(container);
container.innerHTML = output;
expect(output).toBe(test.result);
document.body.removeChild(container);
});
});

Expand Down Expand Up @@ -250,15 +246,11 @@ describe('SSR Creation (JSX)', () => {
}
}

const container = document.createElement('div');
const vDom = <Tester />;

const output = renderToStaticMarkup(vDom);

document.body.appendChild(container);
container.innerHTML = output;
expect(output).toBe('<div>bar2<div>bar2</div></div>');
document.body.removeChild(container);
});
});

Expand Down

0 comments on commit 9702174

Please sign in to comment.