This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82dc11d
commit e89d700
Showing
2 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Contributing to FBExpect | ||
We want to make contributing to this project as easy and transparent as | ||
possible. | ||
|
||
## Our Development Process | ||
|
||
All development is direclty on GitHub. | ||
|
||
## Pull Requests | ||
We actively welcome your pull requests. | ||
|
||
1. Fork the repo and create your branch from `master`. | ||
2. If you've added code that should be tested, add tests. | ||
3. If you've changed APIs, update the documentation. | ||
4. Ensure the test suite passes. | ||
5. Make sure your code lints. | ||
6. If you haven't already, complete the Contributor License Agreement ("CLA"). | ||
|
||
## Contributor License Agreement ("CLA") | ||
In order to accept your pull request, we need you to submit a CLA. You only need | ||
to do this once to work on any of Facebook's open source projects. | ||
|
||
Complete your CLA here: <https://code.facebook.com/cla> | ||
|
||
## Issues | ||
We use GitHub issues to track public bugs. Please ensure your description is | ||
clear and has sufficient instructions to be able to reproduce the issue. | ||
|
||
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe | ||
disclosure of security bugs. In those cases, please go through the process | ||
outlined on that page and do not file a public issue. | ||
|
||
## Coding Style | ||
|
||
Coding should match `hh_format`/`hackfmt` where practical; the key parts are: | ||
|
||
* 2 spaces for indentation rather than tabs | ||
* 80 character line length | ||
* indent, don't align | ||
|
||
## License | ||
|
||
By contributing to definition-finder, you agree that your contributions will be licensed | ||
under the LICENSE file in the root directory of this source tree. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# FBExpect | ||
|
||
FBExpect is a unit testing utility built on top of PHPUnit. The primary goal of | ||
this project is to allow Facebook to release our existing unit tests for other | ||
projects, however it does have advantages for third-party Hack projects: | ||
|
||
- clarity | ||
- type refinment for some assertions | ||
- support for `vec`, `keyset`, and `dict` types | ||
|
||
## Examples | ||
|
||
### Clarity | ||
|
||
It is linguistically clearer which value is the expected value and which is the | ||
actual value: | ||
|
||
```Hack | ||
use Facebook\FBExpect\expect; | ||
// PHPUnit | ||
$this->assertSame($a, $b); | ||
// FBExpect | ||
expect($b)->toBeSame($a); | ||
``` | ||
|
||
### Type Refinement | ||
|
||
```Hack | ||
use Facebook\FBExpect\expect; | ||
// PHPUnit | ||
$this->assertNotNull($x); // Actual test | ||
assert($x !== null); // Tell the typechecker what's going on | ||
$this->assertInstanceOf(Foo::class, $y); | ||
assert($y instanceof Foo); | ||
// FBExpect | ||
$x = expect($x)->toNotBeNull(); | ||
$y = expect($y)->toBeInstanceOf(Foo::class); | ||
``` | ||
|
||
## Installation | ||
|
||
FBExpect is installed via composer: | ||
|
||
``` | ||
hhvm ~/composer require facebook/fbexpect | ||
``` | ||
|
||
FBExpect supports HHVM's PHP7 mode, however as it is also supports | ||
having PHP7 mode disabled, it currently requires PHPUnit 5. | ||
|
||
## License | ||
|
||
FBExpect is BSD-licensed. We also provide an additional patent grant. |