Skip to content

Commit

Permalink
Merge branch 'main' into fix/remove-global
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 29, 2022
2 parents 46d556b + 3326332 commit 7e2e916
Show file tree
Hide file tree
Showing 128 changed files with 6,688 additions and 3,516 deletions.
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
}
]
}
},
{
"files": "packages/vitest/**/*.*",
"rules": {
"no-restricted-globals": [
"error",
"setTimeout",
"clearTimeout",
"setInterval",
"clearInterval",
"performance"
]
}
}
]
}
4 changes: 2 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
if: ${{ github.event.issue.pull_request && (github.event.comment.body == '/bench' || github.event.comment.body == '/benchmark') }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.2.1

- name: Install node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
cache: "pnpm"

Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.2.1

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "pnpm"

- name: Install
run: pnpm i

- name: Lint
run: pnpm run lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.2.1

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "pnpm"

- name: Install
run: pnpm i

- name: Build
run: pnpm run build

- name: Typecheck
run: pnpm run typecheck

test:
runs-on: ${{ matrix.os }}

timeout-minutes: 10

strategy:
matrix:
node_version: [14.x, 16.x]
os: [ubuntu-latest, windows-latest] #, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.2.1

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: "pnpm"

- name: Install
run: pnpm i

- name: Build
run: pnpm run build

- name: Test
run: pnpm run test:ci

test-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.2.1

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "pnpm"

- name: Install
run: pnpm i

- name: Test UI
run: pnpm run ui:test
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.1

- name: Set node version to v16
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/test.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ node_modules
.cache
dist
.idea
ltex*
.DS_Store
bench/test/*/*/
cypress/videos
cypress/downloads
cypress/screenshots
docs/public/user-avatars
docs/public/sponsors
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" height="200">
<img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" height="150">
</p>

<h1 align="center">
Expand All @@ -9,23 +9,25 @@ Vitest
A blazing fast unit test framework powered by Vite.
<p>
<p align="center">
<a href="https://www.npmjs.com/package/vitest"><img src="https://img.shields.io/npm/v/vitest?color=a1b858&label="></a>
<a href="https://www.npmjs.com/package/vitest"><img src="https://img.shields.io/npm/v/vitest?color=729B1B&label="></a>
<p>
<h3 align="center">
<a href="https://chat.vitest.dev"><i>Get involved!</i></a>
</h3>
<br>
<br>

> Vitest requires Vite >=v2.7.10 and Node >=v14

Follow the [Getting Started Guide](https://vitest.dev/guide/) or learn [why we are building a new test runner](https://vitest.dev/guide/why).
<p align="center">
<a href="https://chat.vitest.dev"><b>Get involved!</b></a>
</p>
<p align="center">
<a href="https://vitest.dev">Documentation</a> | <a href="https://vitest.dev/guide/">Getting Started</a> | <a href="https://vitest.dev/guide/#examples">Examples</a> | <a href="https://vitest.dev/guide/why">Why Vitest?</a>
</p>
<p align="center">
<a href="https://cn.vitest.dev">中文文档</a>
</p>

## Documentation

Read the [documentation](https://vitest.dev/).
<h4 align="center">

[Examples](https://vitest.dev/guide/#examples) | [Projects using Vitest](https://vitest.dev/guide/#projects-using-vitest)
</h4>
<br>
<br>

## Features

Expand All @@ -42,6 +44,9 @@ Read the [documentation](https://vitest.dev/).
- Out-of-box TypeScript / JSX support
- Filtering, timeouts, concurrent for suite and tests

> Vitest requires Vite >=v2.7.10 and Node >=v14

```ts
import { assert, describe, expect, it } from 'vitest'

Expand Down
4 changes: 2 additions & 2 deletions bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
},
"devDependencies": {
"@actions/core": "^1.6.0",
"@actions/exec": "^1.1.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.0.0",
"@happy-dom/jest-environment": "^2.47.2",
"@happy-dom/jest-environment": "^2.50.0",
"@types/benchmark": "^2.1.1",
"benchmark": "^2.1.4",
"esmo": "^0.14.1",
Expand Down

0 comments on commit 7e2e916

Please sign in to comment.