mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
fix: tests
This commit is contained in:
@@ -1 +1,2 @@
|
||||
dist/
|
||||
tests/snapshots
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
"@babel/types": "^7.24.0",
|
||||
"@tanstack/config": "^0.7.0",
|
||||
"@types/babel__core": "^7.20.5",
|
||||
"@types/node": "^20.12.7",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"router-generator": "workspace:*",
|
||||
"router-generator": "workspace:*",
|
||||
"vite": "^5.2.10",
|
||||
"vitest": "^1.5.2"
|
||||
},
|
||||
|
||||
@@ -99,7 +99,7 @@ export const splitFile = async ({
|
||||
code,
|
||||
compile,
|
||||
filename,
|
||||
}: SplitFileFnArgs): Promise<void> => {
|
||||
}: SplitFileFnArgs): Promise<CompileOutput> => {
|
||||
console.log('Split file [splitFile fn]', code)
|
||||
return compile({
|
||||
code,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { expect, test } from 'vitest'
|
||||
import { makeCompile, splitFile } from '../src/compiler'
|
||||
import { SPLIT_PREFIX } from '../src/constants'
|
||||
|
||||
async function splitTestFile(opts: { file: string }): void {
|
||||
async function splitTestFile(opts: { file: string }): Promise<void> {
|
||||
const code = (
|
||||
await readFile(path.resolve(__dirname, `./test-files/${opts.file}`))
|
||||
).toString()
|
||||
@@ -28,7 +28,6 @@ test('it compiles and splits', async (): Promise<void> => {
|
||||
// get the list of files from the /test-files directory
|
||||
const files = await readdir(path.resolve(__dirname, './test-files'))
|
||||
for (const file of files) {
|
||||
console.log('Testing:', file)
|
||||
await splitTestFile({ file })
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default function Route(): JSX.Element {
|
||||
return <h1>Test route</h1>
|
||||
return <h1>Test route</h1>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function PostsRoute() {
|
||||
return <h1>Post route</h1>
|
||||
return <h1>Post route</h1>;
|
||||
}
|
||||
export default PostsRoute
|
||||
export default PostsRoute;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
import { ImportedRoute } from '../shared/imported'
|
||||
export default ImportedRoute
|
||||
import { ImportedRoute } from '../shared/imported';
|
||||
export default ImportedRoute;
|
||||
|
||||
Reference in New Issue
Block a user