chore: scaffold Vite + Vitest PWA project
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||
<title>The Director</title>
|
||||
</head>
|
||||
<body>
|
||||
<gm-shell></gm-shell>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "gm-director",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jsdom": "^24.0.0",
|
||||
"vite": "^5.2.0",
|
||||
"vitest": "^1.6.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// Boot entry. Component registration is added in later tasks.
|
||||
export const APP = 'the-director';
|
||||
@@ -0,0 +1,13 @@
|
||||
// tests/smoke.test.js
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { APP } from '../src/main.js';
|
||||
|
||||
describe('scaffold', () => {
|
||||
it('boots and exposes the app id', () => {
|
||||
expect(APP).toBe('the-director');
|
||||
});
|
||||
it('has a working DOM environment', () => {
|
||||
document.body.innerHTML = '<div id="x">hi</div>';
|
||||
expect(document.getElementById('x').textContent).toBe('hi');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
include: ['tests/**/*.test.js'],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user