Skip to content

Instantly share code, notes, and snippets.

@jonmcewen
Last active December 15, 2015 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonmcewen/5270359 to your computer and use it in GitHub Desktop.
Save jonmcewen/5270359 to your computer and use it in GitHub Desktop.
frisby/jasmine-node problem
When I run:
$ jasmine-node --verbose .
I get absolutely no output.
Same with:
$ jasmine-node --verbose frisby.spec.js
However this works:
$ jasmine-node --verbose pure-jasmine.spec.js
A suite
contains spec with an expectation
Finished in 0.148 seconds
1 test, 1 assertion, 0 failures
So there is obviously a problem with the example frisby spec, but I get no indication of what the problem might be.
Spec files and package versions:
---------------------------------
There are 2 spec files in the directory:
pure-jasmine.spec.js:
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect(true).toBe(true);
});
});
frisby.spec.js:
require('frisby');
var URL = 'http://localhost:3000/';
var URL_AUTH = 'http://username:password@localhost:3000/';
frisby.globalSetup({ // globalSetup is for ALL requests
request: {
headers: { 'X-Auth-Token': 'fa8426a0-8eaf-4d22-8e13-7c1b16a9370c' }
}
});
frisby.create('GET user johndoe')
.get(URL + '/users/3.json')
.expectStatus(200)
.expectJSONTypes({
id: Number,
username: String,
is_admin: Boolean
})
.expectJSON({
id: 3,
username: 'johndoe',
is_admin: false
})
// 'afterJSON' automatically parses response body as JSON and passes it as an argument
.afterJSON(function(user) {
// You can use any normal jasmine-style assertions here
expect(1+1).toEqual(2);
// Use data from previous result in next test
frisby.create('Update user')
.put(URL_AUTH + '/users/' + user.id + '.json', {tags: ['jasmine', 'bdd']})
.expectStatus(200)
.toss();
})
.toss();
VERSIONS:
node v0.10.2
$npm list -g
/usr/local/lib
├─┬ frisby@0.6.7
│ ├── mock-request@0.1.2
│ ├─┬ nock@0.16.0
│ │ └── propagate@0.2.2
│ ├── qs@0.4.2
│ ├─┬ request@2.16.6
│ │ ├── aws-sign@0.2.0
│ │ ├── cookie-jar@0.2.0
│ │ ├── forever-agent@0.2.0
│ │ ├─┬ form-data@0.0.7
│ │ │ ├── async@0.1.22
│ │ │ └─┬ combined-stream@0.0.4
│ │ │ └── delayed-stream@0.0.5
│ │ ├─┬ hawk@0.10.2
│ │ │ ├── boom@0.3.7
│ │ │ ├── cryptiles@0.1.3
│ │ │ ├── hoek@0.7.1
│ │ │ └── sntp@0.1.4
│ │ ├── json-stringify-safe@3.0.0
│ │ ├── mime@1.2.9
│ │ ├── node-uuid@1.4.0
│ │ ├── oauth-sign@0.2.0
│ │ ├── qs@0.5.5
│ │ └── tunnel-agent@0.2.0
│ └── underscore@1.2.4
├─┬ jasmine-node@1.4.0
│ ├── coffee-script@1.6.2
│ ├─┬ gaze@0.3.3
│ │ ├─┬ fileset@0.1.5
│ │ │ └─┬ glob@3.1.21
│ │ │ ├── graceful-fs@1.2.0
│ │ │ └── inherits@1.0.0
│ │ └─┬ minimatch@0.2.11
│ │ ├── lru-cache@2.3.0
│ │ └── sigmund@1.0.0
│ ├── jasmine-reporters@0.2.1
│ ├── requirejs@2.1.5
│ ├── underscore@1.4.4
│ └── walkdir@0.0.5
└─┬ npm@1.2.15
├── abbrev@1.0.4
├── ansi@0.1.2
├── archy@0.0.2
├── block-stream@0.0.6
├── chmodr@0.1.0
├── chownr@0.0.1
├── fstream@0.1.22
├─┬ fstream-npm@0.1.4
│ └── fstream-ignore@0.0.6
├── glob@3.1.21
├── graceful-fs@1.2.0
├── inherits@1.0.0
├── ini@1.1.0
├─┬ init-package-json@0.0.6
│ └── promzard@0.2.0
├── lockfile@0.3.0
├── lru-cache@2.3.0
├─┬ minimatch@0.2.11
│ └── sigmund@1.0.0
├── mkdirp@0.3.5
├── node-gyp@0.9.3
├── nopt@2.1.1
├─┬ npm-registry-client@0.2.18
│ └── couch-login@0.1.15
├─┬ npmconf@0.0.23
│ └─┬ config-chain@1.1.5
│ └── proto-list@1.2.2
├── npmlog@0.0.2
├── once@1.1.1
├── opener@1.3.0
├── osenv@0.0.3
├─┬ read@1.0.4
│ └── mute-stream@0.0.3
├── read-installed@0.1.1
├── read-package-json@0.3.0
├── request@2.9.203
├── retry@0.6.0
├── rimraf@2.1.4
├── semver@1.1.4
├── slide@1.1.3
├── tar@0.1.17
├── uid-number@0.0.3
└── which@1.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment