Skip to content

Commit

Permalink
Merge branch 'main' into use-web-hash-history-in-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 24, 2023
2 parents ce9619d + 00c432f commit d43e41f
Show file tree
Hide file tree
Showing 522 changed files with 19,550 additions and 7,496 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Expand Up @@ -9,3 +9,5 @@ coverage
!.vitepress
docs/.vitepress/cache/deps/*.*
test/core/src/self
test/workspaces/results.json
test/reporters/fixtures/with-syntax-error.test.js
13 changes: 13 additions & 0 deletions .eslintrc
Expand Up @@ -36,6 +36,19 @@
}
]
}
},
{
"files": ["docs/**", "packages/web-worker/**", "test/web-worker/**"],
"rules": {
"no-restricted-globals": "off"
}
},
{
"files": ["packages/vite-node/**"],
"rules": {
// false positive on "exports" variable
"antfu/no-cjs-exports": "off"
}
}
]
}
2 changes: 2 additions & 0 deletions .gitattributes
@@ -1 +1,3 @@
* text=auto eol=lf

test/reporters/fixtures/indicator-position.test.js eol=crlf
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,19 @@
### Description

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->

<!-- You can also add additional context here -->

### Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- [ ] It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
- [ ] Ideally, include a test that fails without this PR but passes with it.
- [ ] Please, don't make changes to `pnpm-lock.yaml` unless you introduce a new test example.

### Tests
- [ ] Run the tests with `pnpm test:ci`.

### Documentation
- [ ] If you introduce new functionality, document it. You can run documentation with `pnpm run docs` command.

### Changesets
- [ ] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with `feat:`, `fix:`, `perf:`, `docs:`, or `chore:`.
16 changes: 1 addition & 15 deletions .github/renovate.json5
Expand Up @@ -40,21 +40,7 @@
// wait for ecosystem to upgrade to React v18
"@testing-library/react",
"@testing-library/user-event",
// TODO: migrate
"pretty-format",
// TODO: vite-plugin-pwa issue
"esno",
// user can install any version
"vite",
// TODO: wait for Vite 4 to upgrade Rollup
"rollup",
"@rollup/plugin-alias",
"@rollup/plugin-commonjs",
"@rollup/plugin-json",
"@rollup/plugin-node-resolve",
"rollup-plugin-dts",
"rollup-plugin-esbuild",
"rollup-plugin-license",
"source-map"
"vite"
]
}
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -84,6 +84,9 @@ jobs:
- name: Test Single Thread
run: pnpm run test:ci:single-thread

- name: Test Vm Threads
run: pnpm run test:ci:vm-threads

test-ui:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -122,6 +125,8 @@ jobs:
- uses: browser-actions/setup-chrome@v1
- uses: browser-actions/setup-firefox@v1
- uses: browser-actions/setup-edge@v1
with:
edge-version: beta

- name: Install
run: pnpm i
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/ecosystem-ci-trigger.yml
@@ -0,0 +1,93 @@
name: ecosystem-ci trigger

on:
issue_comment:
types: [created]

jobs:
trigger:
runs-on: ubuntu-latest
if: github.repository == 'vitest-dev/vitest' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
steps:
- uses: actions/github-script@v6
with:
script: |
const user = context.payload.sender.login
console.log(`Validate user: ${user}`)
let hasTriagePermission = false
try {
const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: user,
});
hasTriagePermission = data.user.permissions.triage
} catch (e) {
console.warn(e)
}
if (hasTriagePermission) {
console.log('Allowed')
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: '+1',
})
} else {
console.log('Not allowed')
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: '-1',
})
throw new Error('not allowed')
}
- uses: actions/github-script@v6
id: get-pr-data
with:
script: |
console.log(`Get PR info: ${context.repo.owner}/${context.repo.repo}#${context.issue.number}`)
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
return {
num: context.issue.number,
branchName: pr.head.ref,
repo: pr.head.repo.full_name
}
- id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
private_key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
repository: '${{ github.repository_owner }}/vitest-ecosystem-ci'
- uses: actions/github-script@v6
id: trigger
env:
COMMENT: ${{ github.event.comment.body }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
result-encoding: string
script: |
const comment = process.env.COMMENT.trim()
const prData = ${{ steps.get-pr-data.outputs.result }}
const suite = comment.split('\n')[0].replace(/^\/ecosystem-ci run/, '').trim()
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'vitest-ecosystem-ci',
workflow_id: 'ecosystem-ci-from-pr.yml',
ref: 'main',
inputs: {
prNumber: '' + prData.num,
branchName: prData.branchName,
repo: prData.repo,
suite: suite === '' ? '-' : suite
}
})
24 changes: 24 additions & 0 deletions .github/workflows/lock-closed-issues.yml
@@ -0,0 +1,24 @@
name: Lock Closed Issues

on:
schedule:
- cron: '0 0 * * *'

permissions:
issues: write

jobs:
action:
if: github.repository == 'vitest-dev/vitest'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-inactive-days: '14'
# issue-comment: |
# This issue has been locked since it has been closed for more than 14 days.
#
# If you have found a concrete bug or regression related to it, please open a new [bug report](https://github.com/vitejs/vite/issues/new/choose) with a reproduction against the latest Vite version. If you have any other comments you should join the chat at [Vite Land](https://chat.vitejs.dev) or create a new [discussion](https://github.com/vitejs/vite/discussions).
issue-lock-reason: ''
process-only: issues
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -27,3 +27,4 @@ docs/public/user-avatars
docs/public/sponsors
.eslintcache
docs/.vitepress/cache/
!test/cwd/**/.cache
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -58,6 +58,12 @@ You may wish to test your locally-modified copy of Vitest against another packag

And re-run `pnpm install` to link the package.

Add a `.npmrc` file with following line next to the `package.json`:

```sh
VITE_NODE_DEPS_MODULE_DIRECTORIES=/node_modules/,/packages/
```

## Pull Request Guidelines

- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -35,7 +35,7 @@ A blazing fast unit test framework powered by Vite.
- [Jest Snapshot](https://jestjs.io/docs/snapshot-testing)
- [Chai](https://www.chaijs.com/) built-in for assertions, with [Jest expect](https://jestjs.io/docs/expect) compatible APIs.
- [Smart & instant watch mode](https://vitest.dev/guide/features.html#watch-mode), like HMR for tests!
- [Native code coverage](https://vitest.dev/guide/features.html#coverage) via [c8](https://github.com/bcoe/c8) or [`istanbul`](https://istanbul.js.org/).
- [Native code coverage](https://vitest.dev/guide/features.html#coverage) via [`v8`](https://v8.dev/blog/javascript-code-coverage) or [`istanbul`](https://istanbul.js.org/).
- [Tinyspy](https://github.com/tinylibs/tinyspy) built-in for mocking, stubbing, and spies.
- [JSDOM](https://github.com/jsdom/jsdom) and [happy-dom](https://github.com/capricorn86/happy-dom) for DOM and browser API mocking
- Components testing ([Vue](./examples/vue), [React](./examples/react), [Svelte](./examples/svelte), [Lit](./examples/lit), [Vitesse](./examples/vitesse))
Expand Down
14 changes: 7 additions & 7 deletions bench/package.json
Expand Up @@ -9,12 +9,12 @@
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1",
"@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.21.5",
"@happy-dom/jest-environment": "^9.10.7",
"@babel/preset-env": "^7.22.6",
"@babel/preset-typescript": "^7.22.5",
"@happy-dom/jest-environment": "^9.20.3",
"@types/benchmark": "^2.1.2",
"@vitejs/plugin-vue": "^4.2.1",
"@vue/test-utils": "^2.3.2",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/test-utils": "^2.4.0",
"@vue/vue3-jest": "^29.2.4",
"babel-jest": "^29.5.0",
"benchmark": "^2.1.4",
Expand All @@ -24,8 +24,8 @@
"jest": "^29.5.0",
"markdown-table": "^3.0.3",
"microtime": "^3.1.1",
"ts-jest": "^29.1.0",
"ts-jest": "^29.1.1",
"vitest": "link:../packages/vitest",
"vue": "^3.2.47"
"vue": "^3.3.4"
}
}

0 comments on commit d43e41f

Please sign in to comment.