@vitest/browser 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +33 -0
- package/package.json +49 -0
- package/stubs/fs.js +7 -0
- package/stubs/local-pkg.js +2 -0
- package/stubs/module.js +1 -0
- package/stubs/noop.js +5 -0
- package/stubs/perf_hooks.js +1 -0
- package/stubs/tty.js +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-Present Anthony Fu <https://github.com/antfu>
|
|
4
|
+
Copyright (c) 2021-Present Matias Capeletto <https://github.com/patak-dev>
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @vitest/browser
|
|
2
|
+
|
|
3
|
+
Browser runner for Vitest.
|
|
4
|
+
|
|
5
|
+
> ⚠️ This package is **not yet ready** and it's for preview only. While this package will be released along with other packages, it will not follow semver for breaking changes until we mark it as ready. **Do not use it in production**.
|
|
6
|
+
|
|
7
|
+
## Progress
|
|
8
|
+
|
|
9
|
+
Current Status: **Working in progress**
|
|
10
|
+
|
|
11
|
+
- [x] Init package and integration
|
|
12
|
+
- [x] Stub node packages for Vitest runtime
|
|
13
|
+
- [ ] Works in development mode
|
|
14
|
+
- [ ] Better log in terminal
|
|
15
|
+
- [ ] Fulfill tests (using Browser only APIs, Vue and React components)
|
|
16
|
+
- [ ] Show progress and error on the browser page
|
|
17
|
+
- [ ] Headless mode in CI
|
|
18
|
+
- [ ] Docs
|
|
19
|
+
|
|
20
|
+
Related PRs
|
|
21
|
+
|
|
22
|
+
- [#1302](https://github.com/vitest-dev/vitest/pull/1302)
|
|
23
|
+
|
|
24
|
+
## Development Setup
|
|
25
|
+
|
|
26
|
+
At project root:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm dev
|
|
30
|
+
|
|
31
|
+
cd test/browser
|
|
32
|
+
pnpm vitest --browser
|
|
33
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vitest/browser",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.19.0",
|
|
5
|
+
"description": "Browser running for Vitest",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/vitest-dev/vitest.git",
|
|
9
|
+
"directory": "packages/browser"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./*": "./*"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"stubs"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"local-pkg": "^0.4.1",
|
|
28
|
+
"mlly": "^0.5.2",
|
|
29
|
+
"modern-node-polyfills": "^0.0.7",
|
|
30
|
+
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
31
|
+
"sirv": "^2.0.2"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/ws": "^8.2.2",
|
|
35
|
+
"@vitest/ws-client": "0.19.0",
|
|
36
|
+
"picocolors": "^1.0.0",
|
|
37
|
+
"rollup": "^2.67.2",
|
|
38
|
+
"vitest": "0.19.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "rimraf dist && pnpm build:node && pnpm build:client && pnpm copy",
|
|
42
|
+
"build:client": "vite build",
|
|
43
|
+
"build:node": "rollup -c",
|
|
44
|
+
"dev:client": "vite build --watch",
|
|
45
|
+
"dev:node": "rollup -c --watch --watch.include=node/**",
|
|
46
|
+
"dev": "rimraf dist && run-p dev:node dev:client",
|
|
47
|
+
"copy": "esmo scripts/copy-ui-to-browser.ts"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/stubs/fs.js
ADDED
package/stubs/module.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const createRequire = () => {}
|
package/stubs/noop.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const performance = globalThis.performance
|
package/stubs/tty.js
ADDED