Skip to content

Commit abbbc9c

Browse files
committed
Merge package:fake_async into the core monorepo
2 parents 5876246 + 26a9831 commit abbbc9c

File tree

14 files changed

+1587
-0
lines changed

14 files changed

+1587
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dependabot configuration file.
2+
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
3+
version: 2
4+
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
schedule:
9+
interval: monthly
10+
labels:
11+
- autosubmit
12+
groups:
13+
github-actions:
14+
patterns:
15+
- "*"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# A workflow to close issues where the author hasn't responded to a request for
2+
# more information; see https://github.com/actions/stale.
3+
4+
name: No Response
5+
6+
# Run as a daily cron.
7+
on:
8+
schedule:
9+
# Every day at 8am
10+
- cron: '0 8 * * *'
11+
12+
# All permissions not specified are set to 'none'.
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
17+
jobs:
18+
no-response:
19+
runs-on: ubuntu-latest
20+
if: ${{ github.repository_owner == 'dart-lang' }}
21+
steps:
22+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e
23+
with:
24+
# Don't automatically mark inactive issues+PRs as stale.
25+
days-before-stale: -1
26+
# Close needs-info issues and PRs after 14 days of inactivity.
27+
days-before-close: 14
28+
stale-issue-label: "needs-info"
29+
close-issue-message: >
30+
Without additional information we're not able to resolve this issue.
31+
Feel free to add more info or respond to any questions above and we
32+
can reopen the case. Thanks for your contribution!
33+
stale-pr-label: "needs-info"
34+
close-pr-message: >
35+
Without additional information we're not able to resolve this PR.
36+
Feel free to add more info or respond to any questions above.
37+
Thanks for your contribution!
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# A CI configuration to auto-publish pub packages.
2+
3+
name: Publish
4+
5+
on:
6+
pull_request:
7+
branches: [ master ]
8+
push:
9+
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
10+
11+
jobs:
12+
publish:
13+
if: ${{ github.repository_owner == 'dart-lang' }}
14+
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
15+
permissions:
16+
id-token: write # Required for authentication using OIDC
17+
pull-requests: write # Required for writing the pull request note
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Dart CI
2+
3+
on:
4+
# Run on PRs and pushes to the default branch.
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
schedule:
10+
- cron: "0 0 * * 0"
11+
12+
env:
13+
PUB_ENVIRONMENT: bot.github
14+
15+
jobs:
16+
# Check code formatting and static analysis on a single OS (linux)
17+
# against Dart dev.
18+
analyze:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
sdk: [dev]
24+
steps:
25+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
26+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
27+
with:
28+
sdk: ${{ matrix.sdk }}
29+
- id: install
30+
name: Install dependencies
31+
run: dart pub get
32+
- name: Check formatting
33+
run: dart format --output=none --set-exit-if-changed .
34+
if: always() && steps.install.outcome == 'success'
35+
- name: Analyze code
36+
run: dart analyze --fatal-infos
37+
if: always() && steps.install.outcome == 'success'
38+
39+
# Run tests on a matrix consisting of two dimensions:
40+
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
41+
# 2. release channel: dev
42+
test:
43+
needs: analyze
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
# Add macos-latest and/or windows-latest if relevant for this package.
49+
os: [ubuntu-latest]
50+
sdk: [3.3, dev]
51+
steps:
52+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
53+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
54+
with:
55+
sdk: ${{ matrix.sdk }}
56+
- id: install
57+
name: Install dependencies
58+
run: dart pub get
59+
- name: Run VM tests
60+
run: dart test --platform vm
61+
if: always() && steps.install.outcome == 'success'
62+
- name: Run Chrome tests - js
63+
run: dart test --platform chrome
64+
if: always() && steps.install.outcome == 'success'
65+
- name: Run Chrome tests - wasm
66+
run: dart test --platform chrome --compiler dart2wasm
67+
if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev'

pkgs/fake_async/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.packages
2+
.pub/
3+
.dart_tool/
4+
build/
5+
pubspec.lock

pkgs/fake_async/AUTHORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.

pkgs/fake_async/CHANGELOG.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
## 1.3.2-wip
2+
3+
* Require Dart 3.3
4+
* Fix bug where a `flushTimers` or `elapse` call from within
5+
the callback of a periodic timer would immediately invoke
6+
the same timer.
7+
8+
## 1.3.1
9+
10+
* Populate the pubspec `repository` field.
11+
12+
## 1.3.0
13+
14+
* `FakeTimer.tick` will return a value instead of throwing.
15+
* `FakeAsync.includeTimerStackTrace` allows controlling whether timers created
16+
with a FakeAsync will include a creation Stack Trace.
17+
18+
## 1.2.0
19+
20+
* Stable release for null safety.
21+
22+
## 1.2.0-nullsafety.3
23+
24+
* Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
25+
guidelines.
26+
27+
## 1.2.0-nullsafety.2
28+
29+
* Allow prerelease versions of the 2.12 sdk.
30+
31+
## 1.2.0-nullsafety.1
32+
33+
* Allow 2.10 stable and 2.11.0 dev SDK versions.
34+
35+
## 1.2.0-nullsafety
36+
37+
Pre-release for the null safety migration of this package.
38+
39+
Note that `1.2.0` may not be the final stable null safety release version,
40+
we reserve the right to release it as a `2.0.0` breaking change.
41+
42+
This release will be pinned to only allow pre-release sdk versions starting
43+
from `2.10.0-0`.
44+
45+
## 1.1.0
46+
47+
* Exposed the `FakeTimer` class as a public class.
48+
* Added `FakeAsync.pendingTimers` which gives access to all pending timers at
49+
the time of the call.
50+
51+
## 1.0.2
52+
53+
* Update min SDK to 2.2.0
54+
55+
## 1.0.1
56+
57+
* Update to lowercase Dart core library constants.
58+
* Fix use of deprecated `isInstanceOf` matcher.
59+
60+
## 1.0.0
61+
62+
This release contains the `FakeAsync` class that was defined in [`quiver`][].
63+
It's backwards-compatible with both the `quiver` version *and* the old version
64+
of the `fake_async` package.
65+
66+
[`quiver`]: https://pub.dev/packages/quiver
67+
68+
### New Features
69+
70+
* A top-level `fakeAsync()` function was added that encapsulates
71+
`new FakeAsync().run(...)`.
72+
73+
### New Features Relative to `quiver`
74+
75+
* `FakeAsync.elapsed` returns the total amount of fake time elapsed since the
76+
`FakeAsync` instance was created.
77+
78+
* `new FakeAsync()` now takes an `initialTime` argument that sets the default
79+
time for clocks created with `FakeAsync.getClock()`, and for the `clock`
80+
package's top-level `clock` variable.
81+
82+
### New Features Relative to `fake_async` 0.1
83+
84+
* `FakeAsync.periodicTimerCount`, `FakeAsync.nonPeriodicTimerCount`, and
85+
`FakeAsync.microtaskCount` provide visibility into the events scheduled within
86+
`FakeAsync.run()`.
87+
88+
* `FakeAsync.getClock()` provides access to fully-featured `Clock` objects based
89+
on `FakeAsync`'s elapsed time.
90+
91+
* `FakeAsync.flushMicrotasks()` empties the microtask queue without elapsing any
92+
time or running any timers.
93+
94+
* `FakeAsync.flushTimers()` runs all microtasks and timers until there are no
95+
more scheduled.
96+
97+
## 0.1.2
98+
99+
* Integrate with the clock package.
100+

pkgs/fake_async/CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Want to contribute? Great! First, read this page (including the small print at
2+
the end).
3+
4+
### Before you contribute
5+
6+
Before we can use your code, you must sign the
7+
[Google Individual Contributor License Agreement][CLA] (CLA), which you can do
8+
online. The CLA is necessary mainly because you own the copyright to your
9+
changes, even after your contribution becomes part of our codebase, so we need
10+
your permission to use and distribute your code. We also need to be sure of
11+
various other things—for instance that you'll tell us if you know that your code
12+
infringes on other people's patents. You don't have to sign the CLA until after
13+
you've submitted your code for review and a member has approved it, but you must
14+
do it before we can put your code into our codebase.
15+
16+
Before you start working on a larger contribution, you should get in touch with
17+
us first through the issue tracker with your idea so that we can help out and
18+
possibly guide you. Coordinating up front makes it much easier to avoid
19+
frustration later on.
20+
21+
[CLA]: https://cla.developers.google.com/about/google-individual
22+
23+
### Code reviews
24+
25+
All submissions, including submissions by project members, require review. We
26+
recommend [forking the repository][fork], making changes in your fork, and
27+
[sending us a pull request][pr] so we can review the changes and merge them into
28+
this repository.
29+
30+
[fork]: https://help.github.com/articles/about-forks/
31+
[pr]: https://help.github.com/articles/creating-a-pull-request/
32+
33+
Functional changes will require tests to be added or changed. The tests live in
34+
the `test/` directory, and are run with `pub run test`. If you need to create
35+
new tests, use the existing tests as a guideline for what they should look like.
36+
37+
Before you send your pull request, make sure all the tests pass!
38+
39+
### File headers
40+
41+
When creating new source files, please copy the file header from
42+
https://github.com/dart-lang/fake_async/blob/master/lib/fake_async.dart and
43+
update the year for the copyright to the current year.
44+
45+
### The small print
46+
47+
Contributions made by corporations are covered by a different agreement than the
48+
one above, the
49+
[Software Grant and Corporate Contributor License Agreement][CCLA].
50+
51+
[CCLA]: https://developers.google.com/open-source/cla/corporate

0 commit comments

Comments
 (0)