@mock-filelist/filelist
Version:
This package is a mock generator of FileList and File type object.
86 lines (70 loc) • 3.27 kB
Markdown
# @mock-filelist/filelist
[](https://github.com/Myxogastria0808/mock-filelist/actions/workflows/filelist-test.yaml)
[](https://github.com/Myxogastria0808/mock-filelist/actions/workflows/docs.yaml)
[](https://www.npmjs.com/package/@mock-filelist/filelist)


[](https://www.npmjs.com/package/@mock-filelist/filelist)



[](#)
This package is a mock generator of FileList and File type object for ES Modules users.
> [!IMPORTANT]
> Be sure to use the latest version.
<table>
<tbody>
<tr>
<th rowspan="2"></th>
<th rowspan="2">Required Environment</th>
<th colspan="3">Generatable Objects</th>
<th colspan="2">Available Files</th>
</tr>
<tr>
<th>File</th>
<th>FileList</th>
<th>File[]</th>
<th>Local Files</th>
<th>Files on the Internet</th>
</tr>
<tr>
<td><strong>@mock-filelist/filelist</strong></td>
<td>Node + happy-dom</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr>
<td><a href="https://www.npmjs.com/package/@mock-filelist/browser/">@mock-filelist/browser</a></td>
<td>Browser<br/>or</br/>Node + happy-dom</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>❌</td>
<td>✅</td>
</tr>
<tr>
<td><a href="https://www.npmjs.com/package/@mock-filelist/node/">@mock-filelist/node</a></td>
<td>Node</td>
<td>✅</td>
<td>❌</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
</tr>
</tbody>
</table>
> [!WARNING]
> If you use `jsdom` instead of `happy-dom`, you **cannot** use `@mock-filelist/filelist` and `@mock-filelist/browser`.
## HTML Documentation
https://myxogastria0808.github.io/mock-filelist/filelist/
## Example (React + Vitest + **happy-dom**)
https://github.com/Myxogastria0808/mock-filelist/blob/main/examples/filelist/
## Test Result Generated by @vitest/coverage-v8
https://myxogastria0808.github.io/mock-filelist/filelist/coverage/
## Test Coverage Generated by @vitest/ui
https://myxogastria0808.github.io/mock-filelist/filelist/vitest/
## How to Use
Coming Soon...