Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hugomrdias/playwright-test
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.2
Choose a base ref
...
head repository: hugomrdias/playwright-test
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 15,255 additions and 4,872 deletions.
  1. +0 −16 .editorconfig
  2. +0 −2 .gitattributes
  3. +1 −0 .github/CODEOWNERS
  4. +133 −0 .github/CODE_OF_CONDUCT.md
  5. +134 −0 .github/CONTRIBUTING.md
  6. +4 −18 .github/ISSUE_TEMPLATE/bug_report.md
  7. +3 −4 .github/ISSUE_TEMPLATE/feature_request.md
  8. +18 −0 .github/PULL_REQUEST_TEMPLATE.md
  9. +17 −0 .github/SECURITY.md
  10. +12 −0 .github/dependabot.yml
  11. +74 −22 .github/workflows/main.yml
  12. +3 −1 .gitignore
  13. +658 −0 CHANGELOG.md
  14. +278 −112 cli.js
  15. +8 −8 mocks/before.js
  16. +23 −23 mocks/benchmark.js
  17. +24 −0 mocks/config.js
  18. +11 −0 mocks/console-time.mocha.js
  19. +11 −0 mocks/custom-runner.js
  20. +12 −0 mocks/fixtures.mocha.js
  21. BIN mocks/fixtures/file.tar.gz
  22. +7 −4 mocks/lib.js
  23. +16 −0 mocks/node.test.js
  24. +8 −0 mocks/none/stderr.test.js
  25. +8 −0 mocks/none/stdout.test.js
  26. +1 −0 mocks/sw/sw-globals.js
  27. +14 −0 mocks/sw/sw-test.js
  28. +9 −0 mocks/sw/sw.config.cjs
  29. +13 −0 mocks/sw/sw.config.mjs
  30. +15 −0 mocks/sw/sw.function.config.mjs
  31. +13 −0 mocks/sw/sw.js
  32. +13 −0 mocks/sw/sw.promise.config.mjs
  33. +54 −26 mocks/test.mocha.js
  34. +35 −0 mocks/test.mocha.ts
  35. +28 −10 mocks/test.tape.js
  36. +17 −13 mocks/test1.zora.js
  37. +4 −4 mocks/test2.tape.js
  38. +28 −28 mocks/test2.zora.js
  39. +39 −0 mocks/tinybench.js
  40. +28 −0 mocks/tinybench2.js
  41. +29 −0 mocks/tops/multiple.test.js
  42. +38 −0 mocks/tops/test1.test.js
  43. +50 −0 mocks/tops/test2.test.js
  44. +26 −0 mocks/tops/test3.test.js
  45. +11 −13 mocks/uvu/test1.js
  46. +12 −13 mocks/uvu/test2.js
  47. +148 −89 package.json
  48. +5,733 −0 pnpm-lock.yaml
  49. +222 −29 readme.md
  50. +48 −0 src/client/index.js
  51. +60 −0 src/client/types.ts
  52. +0 −2 src/node-globals.js
  53. +246 −0 src/node/runner.js
  54. +78 −0 src/node/utils.js
  55. +0 −23 src/runner-benchmark.js
  56. +0 −80 src/runner-mocha.js
  57. +0 −27 src/runner-tape.js
  58. +0 −37 src/runner-uvu.js
  59. +0 −68 src/runner-zora.js
  60. +470 −307 src/runner.js
  61. +0 −59 src/setup-bench.js
  62. +0 −26 src/setup-mocha.js
  63. +0 −21 src/setup-tape.js
  64. +0 −13 src/setup-zora.js
  65. +191 −0 src/taps/assert.js
  66. +275 −0 src/taps/harness.js
  67. +94 −0 src/taps/index.js
  68. +89 −0 src/taps/types.ts
  69. +179 −0 src/taps/utils.js
  70. +224 −0 src/test-runners.js
  71. +109 −0 src/types.d.ts
  72. +0 −460 src/utils.js
  73. +99 −0 src/utils/auto-detect.js
  74. +76 −0 src/utils/build-sw.js
  75. +664 −0 src/utils/index.js
  76. +6 −0 src/utils/inject-buffer.js
  77. +83 −0 src/utils/inject-process.js
  78. +60 −0 src/utils/proxy-benchmark.js
  79. +1 −0 src/utils/resolve-empty-fs.js
  80. +3,108 −2,668 src/vendor/benchmark.js
  81. +602 −534 src/vendor/source-map-support.js
  82. +8 −5 static/background.js
  83. +1 −2 static/before.html
  84. +2 −3 static/index.html
  85. +14 −17 static/manifest.json
  86. +21 −18 static/setup.js
  87. +396 −67 test.js
  88. +8 −0 tsconfig.json
16 changes: 0 additions & 16 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @hugomrdias
133 changes: 133 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
the [support email][contact].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
[contact]: mailto:hugomrdias@gmail.com
134 changes: 134 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Contributing to Template

Thank you for helping to improve the project! We are so happy that you are contributing! 💖

You can contribute to the project at any level. Whether you are new to web development or have been at it for ages doesn't matter. We can use your help!

**No contribution is too small, and all contributions are valued.**

This guide will help you to get started. It includes many details, but don't let that turn you away. Consider this a map to help you navigate the process, and please reach out to us with any questions and concerns in the our public [channel] .

## Conduct

Please review our [Code of Conduct] which describes the behavior we expect from all contributors. Please be kind, inclusive, and considerate when interacting with contributors and maintainers.

## Contributing in issues

You can contribute by [opening an issue][issue] to request a feature or report a bug. We also welcome comments on an issue, bug reproductions, and pull requests if you see how to address an issue.

If you are still determining the details of a feature request, you can start with a [discussion][discussions] where we can informally discuss what you have on your mind.

**Anyone can participate in any stage of contribution**. We urge you to
join in the discussion around bugs and comment on pull requests.

### Asking for help

If you have reviewed our [documentation][docs] and still have questions or are having problems, ask for help in the our public [channel] or [start a discussion][discussions].

### Submitting a bug report

We provide a template to give you a starting point when submitting a bug report. Please fill this template in with all relevant information, but feel free to delete any sections that do not apply.

The most important information is describing the problem and how it impacts you. We also invite you to propose a solution, which could be a description of expected behavior.

We very much appreciate it if you could include a [short, self-contained, correct example][sscce] that demonstrates the issue.

## Development

If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started:

- Fork this repository.
- Install dependencies by running `pnpm install`.
- We use [pnpm](https://pnpm.io/) for package management.
- Make sure you have Node LTS installed in your system.
- Optionally run `npx simple-git-hooks` to install git hooks for linting and formatting.
- Implement your changes to files in the `src/` directory and corresponding test files in the `/test` directory.
- Git stage your required changes and commit (see below commit [guidelines](#how-should-i-write-my-commits)).
- Submit PR for review

### Codespaces

This repo has a dev container configuration to enable one click setup of a development environment using Codespaces.

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)][codespaces]

## Pull requests

Pull requests are how we make changes.

Even tiny pull requests to fix typos or improve comments are welcome. Before submitting a significant PR, it is usually best to start by [opening an issue][issue] or [starting a discusssion][discussions]. Taking one of these steps increases the likelihood that your PR will be merged.

All commits must be signed before a pull request will be accepted. See the GitHub [signing commits][signing] and [telling git about your signing key][telling-git] documentation. We recommend generating a new SSH key for signing if you are setting up signing for the first time.

We squash and merge all PRs. Orderly, well-written commits will help us during review, but we don't require a pristine commit history.

### Tests

If your change alters existing code, please run the test suites:

```sh
pnpm run lint
pnpm run test

# node tests can use native watch mode
pnpm test:node -n watch

# browser tests can enable watch
pnpm test:browser --watch
```

If you are adding a new feature, please add tests that prove the code works correctly and reference them when you submit the pull request.

### Opening a pull request

We provide a [pull request template][template] to give you a starting point when creating a pull request. Please fill this template in, but feel free to delete any sections that do not apply or that you are unsure about.

### Discuss and update

You will likely receive feedback or requests for changes to your pull request. Don't be discouraged! Pull request reviews help us all to collaborate and produce better code. Some reviewers may sign off immediately, and others may have more detailed comments and feedback. It's all part of the process of evaluating whether the changes are correct and necessary.

**Once the PR is open, do not rebase the commits.** Add more commits to address feedback. We will squash and merge all contributions, and we may clean up the history recorded in the final commit.

### Merging

The primary goals for a pull request are to improve the codebase and for the contributor to succeed. Some pull requests may not be merged at the end of the day, but that does not indicate failure. If your pull request is not merged, please know that your efforts are appreciated and will have an impact on how we think about the codebase in the long run.

## Release Process

[Release Please](https://github.com/googleapis/release-please) automates CHANGELOG generation, the creation of GitHub releases,
and version bumps for our packages. Release Please does so by parsing your
git history, looking for [Conventional Commit messages](https://www.conventionalcommits.org/),
and creating release PRs.

### What's a Release PR?

Rather than continuously releasing what's landed to our default branch, release-please maintains Release PRs:

These Release PRs are kept up-to-date as additional work is merged. When we're ready to tag a release, we simply merge the release PR.

When the release PR is merged the release job is triggered to create a new tag, a new github release and run other package specific jobs. Only merge ONE release PR at a time and wait for CI to finish before merging another.

Release PRs are created individually for each package in the mono repo.

### How should I write my commits?

Release Please assumes you are using [Conventional Commit messages](https://www.conventionalcommits.org/).

The most important prefixes you should have in mind are:

- `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/)
patch.
- `feat:` which represents a new feature, and correlates to a SemVer minor.
- `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change
(indicated by the `!`) and will result in a SemVer major.

[channel]: https://github.com/hugomrdias/playwright-test/discussions
[codespaces]: https://codespaces.new/hugomrdias/playwright-test
[discussions]: https://github.com/hugomrdias/playwright-test/discussions
[issue]: https://github.com/hugomrdias/playwright-test/issues
[docs]: https://hugomrdias.github.io/playwright-test/
[sscce]: http://www.sscce.org/
[signing]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
[telling-git]: https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key
[template]: PULL_REQUEST_TEMPLATE.md
[Code of Conduct]: CODE_OF_CONDUCT.md
22 changes: 4 additions & 18 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: '[bug]: '
labels: bug, help wanted
assignees: 'hugomrdias'
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@@ -20,19 +20,5 @@ Steps to reproduce the behavior:
**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: '[feature]: '
labels: enhancement, help wanted
assignees: 'hugomrdias'
---

**Is your feature request related to a problem? Please describe.**
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Link to issue

Please add a link to any relevant issues/tickets

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Refactor (non-breaking change that updates existing functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Comments have been added/updated
17 changes: 17 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Security Policy

## Reporting a Vulnerability

The project team welcomes security reports and is committed to providing prompt attention to security issues.

Security issues **SHOULD** be reported privately via [email].

Security issues **SHOULD NOT** be reported via the public GitHub Issue tracker.

## Security advisories

The project team is committed to transparency in the security issue disclosure
process. Security advisories will be published through Github [Security Advisories][sec-advisories].

[email]: mailto:hugomrdias@gmail.com
[sec-advisories]: https://github.com/hugomrdias/playwright-test/security/advisories
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 5
schedule:
interval: monthly
- package-ecosystem: npm
directory: /
open-pull-requests-limit: 5
schedule:
interval: weekly
Loading