-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
131 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/spec/integration/esbuild-typescript/__tests__/develop.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { handleConsoleOutput } = require('../../../helpers'); | ||
|
||
describe('typescript development server', () => { | ||
let url; | ||
|
||
beforeAll(async () => { | ||
const { getUrl } = HopsCLI.start('--fast-dev', '--experimental-esbuild'); | ||
url = await getUrl(); | ||
}); | ||
|
||
it('renders a simple jsx site', async () => { | ||
const { page } = await createPage(); | ||
page.on('console', (msg) => handleConsoleOutput(msg)); | ||
await page.goto(url); | ||
expect(await page.content()).toMatch('<h1>test</h1>'); | ||
|
||
await page.close(); | ||
}); | ||
|
||
it('supports code-splitting', async () => { | ||
const { page } = await createPage(); | ||
page.on('console', (msg) => handleConsoleOutput(msg)); | ||
await page.goto(url); | ||
expect(await page.content()).toMatch('<p>lorem ipsum.</p>'); | ||
|
||
await page.close(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as React from 'react'; | ||
|
||
export default () => <p>lorem ipsum.</p>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
|
||
const Headline = () => <h1>test</h1>; | ||
|
||
export default Headline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { render, importComponent } from 'hops'; | ||
import * as React from 'react'; | ||
import { Helmet } from 'react-helmet-async'; | ||
|
||
import Headline from './headline'; | ||
|
||
const Content = importComponent(() => import('./content')); | ||
|
||
export default render( | ||
<> | ||
<Helmet> | ||
<link rel="icon" href="data:;base64,iVBORw0KGgo=" /> | ||
</Helmet> | ||
<Headline /> | ||
<Content /> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "fixture-esbuild-typescript", | ||
"version": "1.0.0", | ||
"private": true, | ||
"engines": { | ||
"node": "12 || 14 || 15" | ||
}, | ||
"jest": { | ||
"displayName": "integration", | ||
"testEnvironment": "jest-environment-hops", | ||
"setupFilesAfterEnv": [ | ||
"../../jest.setup.js" | ||
] | ||
}, | ||
"hops": { | ||
"gracePeriod": 0 | ||
}, | ||
"scripts": { | ||
"start": "hops start --experimental-esbuild", | ||
"build": "hops build --experimental-esbuild" | ||
}, | ||
"dependencies": { | ||
"esbuild": "*", | ||
"esbuild-jest": "*", | ||
"esbuild-loader": "*", | ||
"hops": "*", | ||
"hops-typescript": "*", | ||
"react": "*", | ||
"react-helmet-async": "*", | ||
"typescript": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "hops-typescript/tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters