2021-03-19 21:07:45 +00:00
|
|
|
import { suite } from 'uvu';
|
|
|
|
import * as assert from 'uvu/assert';
|
|
|
|
import { doc } from './test-utils.js';
|
2021-04-05 18:18:09 +00:00
|
|
|
import { setup } from './helpers.js';
|
2021-03-19 21:07:45 +00:00
|
|
|
|
2021-04-14 00:08:32 +00:00
|
|
|
const Basics = suite('Basic test');
|
2021-03-19 21:07:45 +00:00
|
|
|
|
2021-04-05 18:18:09 +00:00
|
|
|
setup(Basics, './fixtures/astro-basic');
|
2021-03-19 21:07:45 +00:00
|
|
|
|
2021-04-05 18:18:09 +00:00
|
|
|
Basics('Can load page', async ({ runtime }) => {
|
2021-03-19 21:07:45 +00:00
|
|
|
const result = await runtime.load('/');
|
|
|
|
|
|
|
|
assert.equal(result.statusCode, 200);
|
|
|
|
const $ = doc(result.contents);
|
|
|
|
|
|
|
|
assert.equal($('h1').text(), 'Hello world!');
|
|
|
|
});
|
|
|
|
|
2021-04-05 18:18:39 +00:00
|
|
|
Basics.run();
|