Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Add CONTRIBUTING.md and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Jul 3, 2017
1 parent 82dc11d commit e89d700
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
44 changes: 44 additions & 0 deletions CONTRIBUTING.md
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.
57 changes: 57 additions & 0 deletions README.md
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.

0 comments on commit e89d700

Please sign in to comment.