blob: febd689b6921b220619ea74013faffd738d64db4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import { runBuild, runApp } from './test-utils.ts';
import { assertEquals, assert, DOMParser } from './deps.ts';
Deno.test({
name: 'Dynamic imports',
async fn() {
await runBuild('./fixtures/dynimport/');
const stop = await runApp('./fixtures/dynimport/prod.js');
try {
const response = await fetch('http://127.0.0.1:8085/');
assertEquals(response.status, 200);
const html = await response.text();
assert(html, 'got some html');
const doc = new DOMParser().parseFromString(html, `text/html`);
const div = doc.querySelector('#thing');
assert(div, 'div exists');
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
} finally {
await stop();
}
},
});
|