https://github.com/numtel/tinytest-fixture-account
Tinytest fixture to create a user account for client-side tests
https://github.com/numtel/tinytest-fixture-account
Last synced: about 1 year ago
JSON representation
Tinytest fixture to create a user account for client-side tests
- Host: GitHub
- URL: https://github.com/numtel/tinytest-fixture-account
- Owner: numtel
- License: mit
- Created: 2014-10-16T03:43:47.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-16T03:51:37.000Z (over 11 years ago)
- Last Synced: 2025-02-15T04:42:29.726Z (about 1 year ago)
- Language: CoffeeScript
- Size: 113 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tinytest Account Fixture Meteor Package
Create a fixture account for running tests that require being logged in and
then remove the account when complete.
[](https://travis-ci.org/numtel/tinytest-fixture-account)
## Installation
The `accounts-password` package must be installed to use this package.
```bash
$ meteor add accounts-password numtel:tinytest-fixture-account
```
## Example in Coffeescript
```coffee
if Meteor.isClient
Tinytest.addAsync 'needs an account to run', (test, done) ->
fixtureAccount done, {}, (error, cleanup) ->
# Error will be thrown if username exists
throw error if error
# ... Perform test while logged in
# Remove fixture account, done() is called automatically
cleanup()
```
## Run Tests
```bash
$ git clone https://github.com/numtel/tinytest-fixture-account.git
$ cd tinytest-fixture-account
$ meteor test-packages ./
```
Open your browser to `http://localhost:3000/`
## License
MIT