Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 458b8d0

Browse files
author
Miroslav Bajtoš
committed
Merge branch 'release/1.0.4' into production
2 parents 1ccf22b + b654a11 commit 458b8d0

File tree

3 files changed

+149
-5
lines changed

3 files changed

+149
-5
lines changed

CHANGES.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
2014-12-05, Version 1.0.4
2+
=========================
3+
4+
* README: add basic mocha setup instructions (pulkitsinghal)
5+
6+
7+
2014-10-02, Version 1.0.3
8+
=========================
9+
10+
* Update version to 1.0.3 (Simon Ho)
11+
12+
13+
2014-10-02, Version 1.0.2
14+
=========================
15+
16+
17+
18+
2014-10-02, Version 1.0.1
19+
=========================
20+
21+
* package: move chai from devDependencies to dependencies (Simon Ho)
22+
23+
* Add contribution guidelines (Ryan Graham)
24+
25+
26+
2014-09-26, Version 1.0.0
27+
=========================
28+
29+
* Upgrade dependencies (Miroslav Bajtoš)
30+
31+
* add support for testing with users with roles (Jaka Hudoklin)
32+
33+
* fix imports (Jaka Hudoklin)
34+
35+
36+
2014-09-25, Version 0.2.1
37+
=========================
38+
39+
* Fix handling of dynamic URLs in the test builder (Clark Wang)
40+
41+
* Extending tests to cover other methods (ariskemper)
42+
43+
* package: add repository URL (Miroslav Bajtoš)
44+
45+
46+
2014-06-12, Version 0.2.0
47+
=========================
48+
49+
* helpers: add parameter for request body (Miroslav Bajtoš)
50+
51+
* helpers: Improve ACL asserts (Miroslav Bajtoš)
52+
53+
* helpers: fix usage of mocha contexts (Miroslav Bajtoš)
54+
55+
* Drop peer dependency on loopback (Miroslav Bajtoš)
56+
57+
* un-used variable (Karl Mikkelsen)
58+
59+
* tighter status constraints (Karl Mikkelsen)
60+
61+
* extend range of status allowed/denied (Karl Mikkelsen)
62+
63+
64+
2014-06-06, Version 0.1.5
65+
=========================
66+
67+
* Support loopback 2.x (Miroslav Bajtoš)
68+
69+
* Bump loopback dependency (Ritchie Martori)
70+
71+
72+
2014-05-25, Version 0.1.3
73+
=========================
74+
75+
* Remove juggler from peerDependencies. (Miroslav Bajtoš)
76+
77+
* Update to dual MIT/StrongLoop license (Raymond Feng)
78+
79+
80+
2014-02-11, Version 0.1.2
81+
=========================
82+
83+
* Bump version and update deps (Raymond Feng)
84+
85+
86+
2014-01-13, Version 0.1.1
87+
=========================
88+
89+
* Speed up login action (Miroslav Bajtoš)
90+
91+
* Fix function typo (Ritchie Martori)
92+
93+
94+
2013-12-20, Version 0.1.0
95+
=========================
96+
97+
* Relax loopback dependency (Ritchie Martori)
98+
99+
* Factor out LoopBack dep to removing coupling on the exact loopback instance. (Ritchie Martori)
100+
101+
* Remove describe.model (Ritchie Martori)
102+
103+
* Remove beforeEach.withDefaultDataSource (Ritchie Martori)
104+
105+
* Move helpers to lib (Ritchie Martori)
106+
107+
108+
2013-12-13, Version 0.0.4
109+
=========================
110+
111+
* Bump version (Ritchie Martori)
112+
113+
* Move loopback to peerDependencies to avoid using the wrong loopback object (Ritchie Martori)
114+
115+
* Describe TestDataBuilder in README. (Miroslav Bajtos)
116+
117+
118+
2013-12-11, Version 0.0.3
119+
=========================
120+
121+
* First release!

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,31 @@ The following helpers are designed to generate [mocha] tests against
99

1010
## install
1111

12-
```sh
13-
npm install loopback-testing --save-dev
14-
```
12+
1. `npm install loopback-testing --save-dev`
13+
2. Assuming you started with a clean template/project generated by `slc loopback`
14+
1. If you have mocha installed as a global npm module that's great! Simply update `<your_project>/package.json` with:
15+
16+
```
17+
{
18+
...
19+
"scripts": {
20+
...
21+
"test": "mocha"
22+
}
23+
}
24+
```
25+
2. Otherwise, you can utilize the mocha library within the `loopback-testing` testing module:
26+
27+
```
28+
{
29+
...
30+
"scripts": {
31+
...
32+
"test": "./node_modules/loopback-testing/node_modules/.bin/mocha"
33+
}
34+
}
35+
```
36+
3. Run `npm test` to execute any tests under the `test` directory.
1537
1638
## basic usage
1739
@@ -29,6 +51,7 @@ Use the `loopback-testing` module to generate `mocha` tests.
2951
```js
3052
var lt = require('loopback-testing');
3153
var assert = require('assert');
54+
var app = require('../server/server.js'); //path to app.js or server.js
3255

3356
describe('/products', function() {
3457
lt.beforeEach.withApp(app);
@@ -38,7 +61,7 @@ describe('/products', function() {
3861
assert.equal(this.res.statusCode, 200);
3962
});
4063

41-
lt.givenModel('product');
64+
lt.beforeEach.givenModel('product');
4265
it('should respond with an array of products', function() {
4366
assert(Array.isArray(this.res.body));
4467
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loopback-testing",
3-
"version": "1.0.0",
3+
"version": "1.0.4",
44
"description": "Utilities for testing LoopBack applications",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)