-
Notifications
You must be signed in to change notification settings - Fork 109
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
3 changed files
with
36 additions
and
0 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
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 @@ | ||
import { describe, expect, it } from 'vitest' | ||
import fs from 'fs-extra' | ||
import { safeDirname } from '@fiction/core' | ||
|
||
describe('files built', () => { | ||
const dir = safeDirname(import.meta.url, '..') | ||
const distDir = `${dir}/dist` | ||
it('has dist files', async () => { | ||
const files = await fs.readdir(distDir) | ||
|
||
const expectedDirs = ['app', 'sites'] | ||
expect(files).toEqual(expect.arrayContaining(expectedDirs)) | ||
|
||
const expectedFiles = ['client', 'server'] | ||
|
||
for (const dir of expectedDirs) { | ||
const dirFiles = await fs.readdir(`${distDir}/${dir}`) | ||
expect(dirFiles).toEqual(expect.arrayContaining(expectedFiles)) | ||
} | ||
|
||
const clientFiles = ['index.html', 'assets'] | ||
const serverFiles = ['mount.js', 'assets'] | ||
|
||
const clientDirFiles = await fs.readdir(`${distDir}/app/client`) | ||
|
||
expect(clientDirFiles).toEqual(expect.arrayContaining(clientFiles)) | ||
Check failure on line 26 in @fiction/www/test/builtFiles.dist.test.ts GitHub Actions / build and test@fiction/www/test/builtFiles.dist.test.ts > files built > has dist files
|
||
|
||
const serverDirFiles = await fs.readdir(`${distDir}/app/server`) | ||
|
||
expect(serverDirFiles).toEqual(expect.arrayContaining(serverFiles)) | ||
}) | ||
}) |
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